You are still reinitializing the bounds inside the loop and the method
is getLatLng() without the G! Try
function zoommap() {
// initialise bounds object once only
var bounds=new GLatLngBounds();
for (var i=0; i<gmarkers.length; i++) {
if (!gmarkers[i].isHidden()) {
// note proper name for getLatLng() function
var point = new GLatLng(gmarkers[i].getLatLng());
// extend bounds for each displayed marker
bounds.extend(point);
}
}
map.setZoom(map.getBoundsZoomLevel(bounds));
map.setCenter(bounds.getCenter());
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---