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. */ $MapHtml = "
"; SDV($GmapLon, '-122.141944'); SDV($GmapLat, '37.441944'); SDV($GmapZom, 8); SDV($GmapJS, ' '); SDV($GmapCert, ' '); 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.centerAndZoom(point, 4); 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"; }