diff --git a/modules/tagsmap/views/tagsmap_googlemap.html.php b/modules/tagsmap/views/tagsmap_googlemap.html.php index 55b0a272..4fc99fd8 100644 --- a/modules/tagsmap/views/tagsmap_googlemap.html.php +++ b/modules/tagsmap/views/tagsmap_googlemap.html.php @@ -15,31 +15,20 @@ function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); - map.setCenter(new GLatLng(, - )); - map.setZoom(); - map.setUIToDefault(); // Make Google Earth an Option. map.addMapType(G_SATELLITE_3D_MAP); var mapControl = new GMapTypeControl(); map.addControl(mapControl); - + + // Set map defaults. + map.setCenter(new GLatLng(, + )); + map.setZoom(); + map.setUIToDefault(); map.setMapType(); - - - { - - var myGeographicCoordinates = new GLatLng(latitude ?>, - longitude ?>); - map.addOverlay(createMarker(myGeographicCoordinates, - "description ?>", - "tag_id")?>", - "tag_id)->name ?>" - )); - } - - + + // Function for making the clickable markers. function createMarker(point, description, tagURL, tagName) { var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { @@ -47,12 +36,24 @@ "Tag: " + tagName + ""; map.openInfoWindowHtml(point, myHtml); }); - return marker; } + + // Create markers for each tag with GPS coordinates. + + + var myGeographicCoordinates = new GLatLng(latitude ?>, + longitude ?>); + map.addOverlay(createMarker(myGeographicCoordinates, + "description ?>", + "tag_id")?>", + "tag_id)->name ?>" + )); + + } } - + google.setOnLoadCallback(initialize);