Subject: Google Maps API Tutorial -- Overlays
Author: WebSpider
Posted on: 06/22/2009 08:06:19 PM
Overlays are objects on the map that are tied to latitude/longitude coordinates, so they move when you drag or zoom the map. Overlays reflect objects that you "add" to the map to designate points, lines, or areas.
The Maps API has several types of overlays:
Markers -- Points on the map are displayed using markers, which are objects of type GMarker and may make use of the GIcon type.
Polylines -- Lines on the map are displayed using polylines (representing a collection of points). Lines are objects of type GPolyline.
Polygons -- Areas on the map are displayed either as polygons if they are areas of an arbitrary shape or as ground overlays if they are rectangular. Polygons are similar to polylines in that they consist of a collection of points with a closed loop and may take any shape. Ground overlays are often used for areas that map either directly or indirectly to tiles on the map.
Tile -- The map itself is displayed using a tile overlay. You can modify this with your own set of tiles by using a GTileLayerOverlay.
Info Window -- The info window is also a special kind of overlay. Note, however, that the info window is added to the map automatically, and that there can only be one object of type GInfoWindow attached to a map.
Each overlay implements the GOverlay interface. Overlays can be added to a map using the GMap2.addOverlay() method and removed using the Map2.removeOverlay() method.
Replies:
References: