Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

48 Part I — Basics


Lines are drawn from one point to the next in the order they are supplied. Ensure that your
array of points has the correct order before creating the GPolylineobject.

The remainder of the arguments are completely optional:

color: The color of the line (specified using HTML style colors, such as #ff4787).
weight: The width of the line in pixels.

 opacity: The opacity specified as a float between 0 (invisible) and 1 (fully opaque).

GIcon


This class creates a new GIconobject, which is the graphic used to highlight points on a
Google Map.GIcons can be based on any suitable graphic image. If you create your own
GIcon, you must specify at least the following properties before using it in a map:

 image
shadowImage

iconSize
shadowSize

Table 3-8 gives a full list of properties and their descriptions.

Table 3-8: Properties for the GIcon Object

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-hand corner of the
icon image at which you should anchor this icon to the map.
infoWindowAnchor The pixel coordinate relative to the top left-hand corner of the
icon image at which you should anchor the info window to this
icon.
printImage The URL of the foreground icon image you should use for
printed maps. It should be the same size as the main icon image.
Free download pdf