Usage ------ At a minimum, you must use "(:gmap:)," but to set the latitude and longitude, you will have to use a free geocoder (e.g. http://geocoder.us/). The examples below show how you can add text to a bubble over the marker and destination address that allows the site visitor to find directions to the location. Examples: ~~~~~~~~~ (:gmap lat=38.897639 lon=-77.036583:) "Minimum for pointing to a location." (:gmap lat=38.897639 lon=-77.036583 daddr="1600 Pennsylvania, 22303" msg="Joe's Bar and Grill 1600 Ranch Drive Washington, DC 22223":) "Full example with the destination address and message." Variables --------- These are the variables that influence the behavior of the markup. The defaults are recommended for use in the configuration file for your PmWiki Installation. The markup options may be added by the author. Defaults ~~~~~~~~ * $GmapLon = default longitude * $GmapLat = default latitude * $GmapZom = default zoom * $GmapJS (leave blank) * $GmapCert = site certificate. Markup Options ~~~~~~~~~~~~~~ * zom = the zoom level. * lat = lattitude * lon = longitude * daddr = destination address (which allows directions to the address) * msg = what text is displayed in the window over the marker. You will have to provide the HTML. Release Notes ------------- * v1.0 - May 17, 2006: Initial Public Release by Ben Wilson. * v1.01- May 20, 2006: Edit by Des: Amendment offered to allow quick use with true API V2 functions and edited to form %GmapCert using site's $GmapKey value. Note the zoom value in V2 is reversed (0 is zoomed fully out, larger numbers zoom in closer). The new figure is simply 17 minus the old figure. The latitude and longitude figures in GLatLng(lat,lng) are reversed compared to the former Gpoint(lng,lat) format. setCenter replaces centerAndzoom. Gmap is replaced by Gmap2. The scale control has also been added. */ $MapHtml = "
"; SDV($GmapLon, '-122.141944'); SDV($GmapLat, '37.441944'); SDV($GmapZom, 3); SDV($GmapJS, ' '); SDV($GmapCert, ' '); SDV($GmapKey, ' '); Markup('gmap', 'block', '/\(:gmap(.*?):\)/e', 'Gmap("$1");'); function Gmap($input='') { global $GmapLon, $GmapLat, $GmapZom, $GmapJS, $GmapCert, $GmapKey; global $MapHtml, $ScriptHtml; $GmapCert = ''; $opt = ParseArgs($input); $zom = ($opt['zom']) ? $opt['zom'] : $GmapZom; $lat = ($opt['lat']) ? $opt['lat'] : $GmapLat; $lon = ($opt['lon']) ? $opt['lon'] : $GmapLon; $dad = ($opt['daddr']) ? $opt['daddr'] : $GmapDaddr; if ($opt['msg']) { $opt['msg'] = preg_replace('/>/','>',$opt['msg']); $opt['msg'] = preg_replace('/</','<',$opt['msg']); $crap =<< //$opt[msg]'; $crap var marker = new GMarker(point); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addControl(new GScaleControl()); map.setCenter(point, $zom); map.addOverlay(marker); $window } else { alert("Sorry, the Google Maps API is not compatible with this browser. Please visit http://www.mapquest.com for an alternative."); } //]]> GMAPJS; return "$MapHtml"; }