From GamingWiki
Line 22: | Line 22: | ||
var infowindow; | var infowindow; | ||
var markers = new Array(); | var markers = new Array(); | ||
+ | var GMarkers = new Array(); | ||
+ | var defaultLatLng = new google.maps.LatLng(43.243702,-79.889145); | ||
+ | var defaultZoom = 12; | ||
function initialize() { | function initialize() { | ||
− | |||
var myOptions = { | var myOptions = { | ||
− | zoom: | + | zoom: defaultZoom, |
− | center: | + | center: defaultLatLng, |
mapTypeId: google.maps.MapTypeId.ROADMAP | mapTypeId: google.maps.MapTypeId.ROADMAP | ||
} | } | ||
Line 47: | Line 49: | ||
infowindow.open(map,marker); | infowindow.open(map,marker); | ||
}); | }); | ||
+ | GMarkers[descId] = marker; | ||
} | } | ||
/** | /** | ||
Line 85: | Line 88: | ||
} | } | ||
} | } | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Centre on a particular location on the map, if it exists | ||
+ | */ | ||
+ | function recentre(key) { | ||
+ | var newLatLng = defaultLatLng; | ||
+ | if (key) { | ||
+ | aMarker = GMarkers[key]; | ||
+ | if (typeof aMarker !== 'undefined') { | ||
+ | newLatLng = aMarker.getPosition(); | ||
+ | aMarker.click(); | ||
+ | } | ||
+ | } | ||
+ | map.setCenter(newLatLng); | ||
} | } | ||
// --></script> | // --></script> | ||
</html> | </html> |
Revision as of 19:36, 16 May 2011