Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (28 sloc) 1.061 kb
7ae9baa Modified maps, added text to places.kml, updated index
Alexander Jegtnes authored
1 <?php
2
3 include_once("commonlib.php");
4 $config = loadConfig("config.xml");
5 $city1 = $config['city1'];
6 $city2 = $config['city2'];
7
8
9 function renderMap($lat,$lng) {
10
11 $divId = "map-" . md5($lat . $lng);
12 $div = "<div class=\"map\" id=\"$divId\"></div>";
13
14 $script = "<script type=\"text/javascript\">
15 //<![CDATA[
16
17 if (GBrowserIsCompatible()) {
18
19 var cityMap1 = new GMap2(document.getElementById(\"$divId\"));
20 cityMap1.addControl(new GLargeMapControl());
21 cityMap1.addControl(new GMapTypeControl());
22 cityMap1.setCenter(new GLatLng($lat,$lng), 13);
23
24 // Create the KML Overlay (hosted externally for Google to be able to tunnel in and retrieve the file)
25
edb0a9c Styled instagram pictures, added final KML for Google maps.
Alexander Jegtnes authored
26 var cityOverlay1 = new GGeoXml(\"http://www.charlietizard.com/uni/dsa/places.kml\");
7ae9baa Modified maps, added text to places.kml, updated index
Alexander Jegtnes authored
27 cityMap1.addOverlay(cityOverlay1);
28
29 }
30
31 // display a warning if the browser was not compatible
32 else {
33 alert(\"Sorry, the Google Maps API is not compatible with this browser\");
34 }
35
36 //]]>
37 </script>";
38
39 return $div . $script;
40
41 }
42
43 ?>
Something went wrong with that request. Please try again.