-function wrMapParserFirstCallInit() {
- global $wgParser;
- global $wgGoogleMapsKey;
- $wrGoogleMaps = new WrGoogleMaps($wgGoogleMapsKey);
- $wgParser->setHook('wrgmap', array($wrGoogleMaps, 'render'));
- return true;
-}
-
-
-
-// Java script
-// -----------
-
-// Global JavaScript functions
-define('WRGMAPJSFUNCTIONS', <<<JAVASCRIPT
-<script type="text/javascript">
-//<![CDATA[
-var wrSleddingIcon = new GIcon(G_DEFAULT_ICON);
-wrSleddingIcon.image = "/vorlagen/gmap_rodelbahn_c.png";
-wrSleddingIcon.shadow = "/vorlagen/gmap_rodelbahn_c_s.png";
-wrSleddingIcon.iconSize = new GSize(17, 17);
-wrSleddingIcon.shadowSize = new GSize(23, 23);
-wrSleddingIcon.iconAnchor = new GPoint(9, 9);
-wrSleddingIcon.infoWindowAnchor = new GPoint(9, 9);
-
-
-function wrCreateMarker(latitude, longitude, name, icon) {
- var point = new GLatLng(latitude, longitude);
- var marker = new GMarker(point, icon);
- var articlePath = "$wgArticlePath";
- var p = articlePath.replace("\$1", name.replace(' ', '_'));
- GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml("<strong><a href='" + p + "'>" + name+ "</a></strong>");});
- return marker;
-}
-//]]>
-</script>
-JAVASCRIPT
-);
-
-
-/** This class was inpired by the GoogleMaps class of the GoogleMaps extension. */
-class WrGoogleMaps {
- /// the Google API key (obtained from
- /// http://www.google.com/apis/maps/signup.html)
- private $apiKey = null;
-
- /// How many <wrgmap> tags are on the current page?
- private $mapsCount = 0;
-
- /// Constructor
- function WrGoogleMaps($apiKey) {
- $this->apiKey = $apiKey;
- }
-