Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 10 — Overlaying Statistical Data 201


Finally, change the opacity of the shadow to between 35 percent and 50 percent to ensure that
the shadow looks like a shadow and not an image in its own right.


You now have an icon and shadow to display on your map.


Creating a Google Map Icon
Actually creating the icon within the Google Map is straightforward, provided the rules for the
icon are understood. The GIcon()class is used to specify the icon detail and you should, at a
minimum, specify the following:


The URL of the icon image.
The URL of the shadow image.

The icon size width, then height (in pixels).
The shadow size width, then height (in pixels).

The anchor point (the point in the image that will be placed directly over the latitude
and longitude for the marker).
The anchor point for the info window.

The anchor point for the info window shadow.

The different values are explained in Figure 10-12.


FIGURE10-12: Understanding icon parameters.


Shadow Width

Icon Width

Icon/Shadow
Height


AnchorPoint
Free download pdf