Given a page with two maps on it, I don't seem to be able to show the
map controls on either map. If I remove one of the maps so that there
is only one map on the page, then the controls appear properly. Anyone
have any idea why the controls don't get shown when I have two maps on
a page?
* HTML Page *
<div id="map-1" class="map-container"></div>
<div id="map-2" class="map-container"></div>
<script type="text/javascript">
document.observe('dom:loaded', function() {
new AddressTrack('map-1', '50', '-120');
new AddressTrack('map-2', '52', '-120');
});
</script>
* Javascript File *
function AddressTrack(containerID, latitude, longitude) {
google.load("maps", "2", {"callback" : function() {
if (GBrowserIsCompatible()) {
var map = new
google.maps.Map2(document.getElementById(containerID));
map.setCenter(new google.maps.LatLng(latitude, longitude),
14);
map.setMapType(G_HYBRID_MAP);
map.addControl(new google.maps.SmallMapControl());
}
Event.observe(window, 'unload', function()
{ google.maps.Unload(); });
}});
}
Each map is getting properly set to the correct LatLng, but the
controls are not getting displayed. If I comment out the second (or
first) call to 'new AddressTrack()' in the HTML page, then the
remaining map will correctly show the controls.
Thanks for any help offered.
Sincerely,
Kenny
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---