Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 10 — Overlaying Statistical Data 197


Using Custom Icons


Polylines are an efficient way of representing information, but they are limited in that the
amount of information they can represent is small in comparison to the amount of the work
that is required to build the information displayed. With work, you could draw a 3D bar or use
alternative methods to draw different diagrams to highlight the content, but the more lines you
have to draw, the more work is required. That probably isn’t an efficient way of representing the
information.

Another alternative is to use custom icons to show the information onscreen. An icon is used
when a marker is placed on the map, and it is possible to change the icon to almost any image
that you like. By changing the image or altering its size, the marker icon can be used to show
the volume and value of statistical information in the same way the polylines were employed
earlier in this chapter.

Before choosing and setting an image, you should consider how that image is specified and
defined.

Building Your Own Icon


Good icons consist of two elements: the icon and its shadow, although the shadow is techni-
cally an optional element. You can either build your own icon or copy an image from another
location and turn it into an icon. The key issue is to ensure that your icon makes sense as an
icon and can be easily placed onto a map.

Choosing an Icon Style
The most important aspect of your icon is that it should have an anchor point that can be
associated with the precise point on your Google Map. You can see from the sample markers
used in Google Maps applications that they generally have a pushpin or tack feel that pro-
vides a pinpoint that can be attached to the latitude and longitude of the point you are
highlighting.

Tips for creating or choosing good Google Maps icons include the following:

It should have an identifiable anchor point, which is usually exactly that: a point, pin, or
other element that points to the location on the map you want.

It should be relatively small. The icon is designed to highlight a point on the map, not
dominate it.
It ideally should not be used to provide information, short of marking the point on the
map. Use an InfoWindowor other display element to show the information.

That doesn’t mean you can’t use other images, but it does mean that you should give some con-
sideration to the icon you choose.
Free download pdf