Recently updated and confirmed still working with WordPress 3.0.
The following examples use the included example.xml file.
<markers> <!-- Marker Z has no html to show nonclickability--> <marker lat="-31.9554" lng="115.85859" icon="Z" color="c89bff"/> <marker lat="-32.053128" lng="115.745869" html="Fremantle" icon="1" color="6b98ff"/> <!-- Standard marker with html--> <marker lat="-32.036036" lng="115.92724" html="Lynwood<br>Residence of the author" color="ffed5c"/> <marker lat="-31.963013" lng="115.836239" html="Kings Park" icon="KP" color="97ec7d"/> <!-- Character marker with html that includes link--> <marker lat="-31.956659" lng="115.869906" html="<a href="http://perthmint.com.au" rel="nofollow">Perth Mint</a>" icon="$" color="ffffff"/> <line colour="#0000FF" width="2" opacity="0.75"> <point lat="-32.027579" lng="115.751266" /> <point lat="-31.987404" lng="115.769463" /> <point lat="-31.957697" lng="115.852203" /> <point lat="-31.963814" lng="115.879326" /> <point lat="-32.026415" lng="115.942154" /> </line> </markers>
- Marker Z – no HTML, nonclickable.
- Marker 1 – standard maker with some text.
- Marker Default – no icon defaults to standard Google Maps marker.
- Marker $ – some symbols can even be displayed on a marker and links in the HTML.
- Marker KP – up to two characters can be displayed.
The syntax is as follows;
tgm(example.xml, width, height, zoom, maptype)
where;
- example.xml is your xml file, and example xml file is included with tgm in the plugin directory.
- width is the optional width parameter, if left out the default width defined in the tgm options will be used.
- height is the optional height parameter, if left out the default height defined in the tgm options will be used.
- zoom is the optional zoom level from 0 to 17 (0 being the furthest away), if left out zoom will be calculated automatically to fit all points.
- maptype is the optional map type parameters, which can be (Normal, G_NORMAL_MAP, N), (SATELLITE, G_SATELLITE_MAP, S), (HYBRID, G_HYBRID_MAP, H), (PHYSICAL, G_PHYSICAL_MAP, P, TERRAIN or T) if left out Normal is defined.
Normal, G_NORMAL_MAP, N or left out; i.e. tgm(example.xml), tgm will produce a default styled map;
tgm(example.xml)
SATELLITE, G_SATELLITE_MAP, S; i.e. tgm(example.xml, 4, S), tgm will produce a satellite styled map. Note I have included a zoom of 4, and used the abreviation ‘S’;
tgm(example.xml, 4, S)
HYBRID, G_HYBRID_MAP, H; i.e. tgm(example.xml,hYbRiD,450,225), tGoolgeMap will produce a hybrid styled map. Note I have included a width and height, and proved that capitalisation is not of concern;
tgm(example.xml, hYbRiD, 450,225)
PHYSICAL, G_PHYSICAL_MAP, P, TERRAIN or T; i.e tgm(example.xml,TERRAIN), tgmwill produce a terrain styled map;
tgm(example.xml,TERRAIN)
Reading XML from different folder
The XML can be in any location, as long as the whole path is specified i.e. tgm(https://mectile.com/geocaching/karratha-mar08/karratha-mar08.xml). Yes, even links in the marker text are preserved.
tgooglemap(https://mectile.com/geocaching/karratha-mar08/karratha-mar08.xml)
Reading XML from different domain
The XML can even be on a different domain, as long as the whole path is specified. i.e. tgm(http://xxxxxx.com/maps/our-nullarbor-adventure-clare-melbourne08.xml).
tgooglemap(http://xxxxxx.com/maps/our-nullarbor-adventure-clare-melbourne08.xml)
Leave a Reply