GIcon [class]-GoogleMaps/API/doc/ClassReference/06-GIcon-N☆E 学習帳

[ リロード ]   [ ソース ]  [ トップ | 一覧 | 単語検索 | 最新 | バックアップ | ヘルプ ]

Counter: 4063, today: 1, yesterday: 1

GIcon [class]

http://www.google.com/apis/maps/docu­mentation/

Version 2 (2006.4)

An icon specifies the images used to display a GMarker on the map. For browser compatibility reasons, specifying an icon is actually quite complex. Note that you can use the default Maps icon G_DEFAULT_ICON if you don't want to specify your own.

Constructor

Constructor Description
GIcon(copy?, image?) Creates a new icon object. If another icon is given in the optional copy argument, its properties are copied, otherwise they are left empty. The optional argument image sets the value of the image property.

 

Constants

Constants Description
G_DEFAULT_ICON The default icon used by markers.

 

Properties

Properties Type Description
image String The foreground image URL of the icon.
shadow String The shadow image URL of the icon.
iconSize GSize The pixel size of the foreground image of the icon.
shadowSize GSize The pixel size of the shadow image.
iconAnchor GPoint The pixel coordinate relative to the top left corner of the icon image at which this icon is anchored to the map.
infoWindowAnchor GPoint The pixel coordinate relative to the top left corner of the icon image at which the info window is anchored to this icon.
printImage String The URL of the foreground icon image used for printed maps. It must be the same size as the main icon image given by image.
mozPrintImage String The URL of the foreground icon image used for printed maps in Firefox/Mozilla. It must be the same size as the main icon image given by image.
printShadow String The URL of the shadow image used for printed maps. It should be a GIF image since most browsers cannot print PNG images.
transparent String The URL of a virtually transparent version of the foreground icon image used to capture click events in Internet Explorer. This image should be a 24-bit PNG version of the main icon image with 1% opacity, but the same shape and size as the main icon.
imageMap Array of Number An array of integers representing the x/y coordinates of the image map we should use to specify the clickable part of the icon image in browsers other than Internet Explorer.

 

Version 1

An icon specifies the images used to display a marker on the map. For browser compatibility reasons, specifying an icon is actually quite complex. See the discussion above for more information.
 
At a minimum, you must specify the image, shadowImage, iconSize, shadowSize, and iconAnchor properties of an icon before it can be displayed on the map. If you use info windows, you must also specify the infoWindowAnchor property of the icon.

Constructor

Constructor Description
GIcon(copy?) Creates a new icon, copying the properties of the given icon if given.

 

Properties

Property Description
image The foreground image URL of the icon
shadow The shadow image URL of the icon
iconSize The pixel size of the foreground image of the icon
shadowSize The pixel size of the shadow image
iconAnchor The pixel coordinate relative to the top left corner of the icon image at which we should anchor this icon to the map
infoWindowAnchor The pixel coordinate relative to the top left corner of the icon image at which we should anchor the info window to this icon
printImage The URL of the foreground icon image we should use for printed maps. It should be the same size as the main icon image.
mozPrintImage The URL of the foreground icon image we should use for printed maps in Firefox/Mozilla. It should be the same size as the main icon image.
printShadow The URL of the shadow image we should use for printed maps. It should be a GIF image since most browsers cannot print PNG images.
transparent The URL of a virtually transparent version of the foreground icon image used to capture IE click events. This image should be a 24-bit PNG version of the main icon image with 1% opacity, but the same shape and size as the main icon.
imageMap An array of integers representing the x/y coordinates of the image map we should use to specify the clickable part of the icon image in non-IE browsers.