TagsMap fix for Firefox.
Signed-off-by: Bharat Mediratta <bharat@menalto.com>
This commit is contained in:
parent
597447673d
commit
c5071ef956
@ -15,31 +15,20 @@
|
|||||||
function initialize() {
|
function initialize() {
|
||||||
if (GBrowserIsCompatible()) {
|
if (GBrowserIsCompatible()) {
|
||||||
var map = new GMap2(document.getElementById("map_canvas"));
|
var map = new GMap2(document.getElementById("map_canvas"));
|
||||||
map.setCenter(new GLatLng(<?=$google_map_latitude ?>,
|
|
||||||
<?=$google_map_longitude ?>));
|
|
||||||
map.setZoom(<?=$google_map_zoom ?>);
|
|
||||||
map.setUIToDefault();
|
|
||||||
|
|
||||||
// Make Google Earth an Option.
|
// Make Google Earth an Option.
|
||||||
map.addMapType(G_SATELLITE_3D_MAP);
|
map.addMapType(G_SATELLITE_3D_MAP);
|
||||||
var mapControl = new GMapTypeControl();
|
var mapControl = new GMapTypeControl();
|
||||||
map.addControl(mapControl);
|
map.addControl(mapControl);
|
||||||
|
|
||||||
|
// Set map defaults.
|
||||||
|
map.setCenter(new GLatLng(<?=$google_map_latitude ?>,
|
||||||
|
<?=$google_map_longitude ?>));
|
||||||
|
map.setZoom(<?=$google_map_zoom ?>);
|
||||||
|
map.setUIToDefault();
|
||||||
map.setMapType(<?=$google_map_type ?>);
|
map.setMapType(<?=$google_map_type ?>);
|
||||||
|
|
||||||
<? foreach ($tags_gps as $oneGPS): ?>
|
// Function for making the clickable markers.
|
||||||
{
|
|
||||||
|
|
||||||
var myGeographicCoordinates = new GLatLng(<?= $oneGPS->latitude ?>,
|
|
||||||
<?= $oneGPS->longitude ?>);
|
|
||||||
map.addOverlay(createMarker(myGeographicCoordinates,
|
|
||||||
"<?= $oneGPS->description ?>",
|
|
||||||
"<?= url::site("tags/$oneGPS->tag_id")?>",
|
|
||||||
"<?= ORM::factory("tag", $oneGPS->tag_id)->name ?>"
|
|
||||||
));
|
|
||||||
}
|
|
||||||
<? endforeach ?>
|
|
||||||
|
|
||||||
function createMarker(point, description, tagURL, tagName) {
|
function createMarker(point, description, tagURL, tagName) {
|
||||||
var marker = new GMarker(point);
|
var marker = new GMarker(point);
|
||||||
GEvent.addListener(marker, "click", function() {
|
GEvent.addListener(marker, "click", function() {
|
||||||
@ -47,12 +36,24 @@
|
|||||||
"Tag: <a href=\"" + tagURL + "\">" + tagName + "</a>";
|
"Tag: <a href=\"" + tagURL + "\">" + tagName + "</a>";
|
||||||
map.openInfoWindowHtml(point, myHtml);
|
map.openInfoWindowHtml(point, myHtml);
|
||||||
});
|
});
|
||||||
|
|
||||||
return marker;
|
return marker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create markers for each tag with GPS coordinates.
|
||||||
|
<? $counter = 0; ?>
|
||||||
|
<? foreach ($tags_gps as $oneGPS): ?>
|
||||||
|
var myGeographicCoordinates<?=$counter; ?> = new GLatLng(<?= $oneGPS->latitude ?>,
|
||||||
|
<?= $oneGPS->longitude ?>);
|
||||||
|
map.addOverlay(createMarker(myGeographicCoordinates<?=$counter; ?>,
|
||||||
|
"<?= $oneGPS->description ?>",
|
||||||
|
"<?= url::site("tags/$oneGPS->tag_id")?>",
|
||||||
|
"<?= ORM::factory("tag", $oneGPS->tag_id)->name ?>"
|
||||||
|
));
|
||||||
|
<? $counter++; ?>
|
||||||
|
<? endforeach ?>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
google.setOnLoadCallback(initialize);
|
google.setOnLoadCallback(initialize);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user