Extension:Google Maps/Syntax

In many cases you can get by with the Editor's Map, but understanding the underlying syntax will unlock a few extra features for you.

Tag Attributes
This extension defines a tag. Legal attributes are:


 * width (in pixels; defaults to 450)
 * height (in pixels; defaults to 300)
 * lat (the center latitude on the map, defaults to my old dorm room :-)
 * lon (the center longitude on the map)
 * zoom (the zoom level; 0 is the furthest away, 17 is the closest in)
 * type (legal values are normal (or, equivalently, map), hybrid, and satellite; defaults to hybrid)
 * controls (small creates +/- zoom buttons, medium has zoom buttons and pan buttons, large has pan buttons with a sliding scale for zoom, and none has no buttons)
 * selector (show the map/hybrid/satellite selector? Legal values are yes (default) and no.)
 * scale (show the distance scale? Legal values are yes and no (default).)
 * overview (show the inset navigation map? Legal values are yes and no (default).)
 * icons (URL template for custom markers, with "{label}" where the name of the icon will be inserted; defaults to " http://maps.google.com/mapfiles/marker{label}.png ")
 * icon (URL for markers without an icon specified; defaults to http://maps.google.com/mapfiles/marker.png)
 * doubleclick new in 0.7.6 (what to do when the user double-clicks? legal values are recenter (default) and zoom)
 * zoomstyle new in 0.7.6 (legal values are fast (default) and smooth, also known as continuous zooming; only works in some browsers)
 * stroke new in 0.8.0 (width of paths, in pixels)

All attributes are optional.

Markers
In the content of the tag, you can define one marker per line. Each line may or may not start with an icon name in parentheses; unless you set the "icons" attribute, legal icon names are the upper-case letters of the alphabet. The line should then have the latitude, then a comma, optionally a space, then the longitude, then a comma, then a label for the point. The label can include wiki mark-up (and commas). These are all legal:

 42.711618,-73.205112,the fabulous, famous Sawyer Library 42.711618, -73.205112, the fabulous, famous Sawyer Library (S) 42.711618, -73.205112, the fabulous, famous Sawyer Library

Because the "icons" attribute defaults to " http://maps.google.com/mapfiles/marker{label}.png ", that last marker will use the icon http://maps.google.com/mapfiles/markerS.png. You can host your own collection of icons on your server, but note that they'll have the same anchor points as Google's default icon. Check out Mapki's collection of icon images for a bunch of icons you can use. To use your icons, add an icon attribute to your googlemap-tags like this 

Paths
This feature must first be enabled on your wiki; see Extension:Google Maps/Installation

To connect multiple points with a colored path, prefix them with a line that begins with the color in RGB hex format., e.g.

42.711618,-73.205112 42.714779,-73.204544
 * 1) 330000

That will connect the two points with a colored line. Any points not on a line should appear before all points on lines. For example:

42.711618, -73.25112, this point is not on a line 43.224024, -70.28301, neither is this one 42.202452, -72.83101, this is on a line of color #77077 45.214425, -72.48114, so is this 42.201324, -70.95811, this starts a second line 43.404142, -73.44514, this is also on the second line Any text on same line as, but appearing after, the color specification will be ignored.
 * 1) 770077
 * 1) 668800

You'll probably want to use the Extension:Google Maps/Editor's Map to generate this syntax.

Areas
New in 0.8.0

Areas are enclosed paths with a colored filling. The syntax is just like a path, except that the interior color should be specified in parentheses after the path color, like this:


 * 1) 770077 (#668800)

Tabs
A feature new to 0.7 are tabbed info balloons. Each tab should have a plain-text title surrounded by inward-leaning slashes (like /this\) followed by a caption that can include wiki mark-up. Tabs will be attached to the previous marker. Example:

45.214425, -72.48114 /Info\       This is where Ulysses Grant is buried /Directions\ Click here to get driving directions

That will create a point whose info balloon has two tabs. Note that you can put as much or as little space as you'd like between the title and the caption to make the syntax more readable.

If a point has a regular caption and tabbed captions, clicking the point will only show the tabbed captions.