if (isset($args['lat'])) $latitude = floatval($args['lat']); else $latitude = 47.267648;
if (isset($args['lon'])) $longitude = floatval($args['lon']); else $longitude = 11.404655;
if (isset($args['zoom'])) $zoom = intval($args['zoom']); else $zoom = 10; // Google Zoom Level
+ $staticSizeX = 600;
+ $staticSizeY = 450;
// Query database
$dbr = wfGetDB(DB_SLAVE);
$output .= WRGMAPJSFUNCTIONS;
}
+ // Create static map image link
+ $staticLink = "http://maps.google.com/staticmap?center=$latitude,$longitude&zoom=$zoom&size=${staticSizeX}x$staticSizeY&key=$this->apiKey";
+ $staticMarkers = array();
+ foreach ($sleddingRoutes as $s) {
+ $lat = $s['position_latitude'];
+ $lon = $s['position_longitude'];
+ $staticMarkers[] = sprintf('%.3f,%.3f,bluer', $lat, $lon);
+ }
+ if (count($staticMarkers) > 0) $staticLink .= '&' . implode('|', $staticMarkers);
+
// Create <div/> element where the map is placed in
$mapName = 'wrgmap' . $this->mapsCount;
$output .= '<div id="' . $mapName . '" style="width: 100%; height: 450px; border-style:none;"></div>';
if (!$lat || !$lon) continue;
$output .= $this->addJsMarker($lat, $lon, $pageTitle);
}
+ $output .= "} else {\n"; // browser not compatible -> create static map
+ $output .= "\tdocument.write(\"<img alt=\\\"Landkarte mit Rodelbahnen\\\" src=\\\"" . htmlspecialchars($staticLink) . "\\\" width=\\\"$staticSizeX\\\" height=\\\"$staticSizeY\\\" />\");\n";
$output .= "}\n//]]>\n</script>\n";
+ $output .= '<noscript><img alt="Landkarte mit Rodelbahnen" src="' . htmlspecialchars($staticLink) . "\" width=\"$staticSizeX\" height=\"$staticSizeY\" /></noscript>\n";
+
return wrMapReplaceByMarker($output);
}