// map: an instance of GMap2
// latlng: an array of instances of GLatLng
var latlngbounds = new GLatLngBounds();
for (var i = 0; i < latlng.length; i++)
{
latlngbounds.extend(latlng[i]);
}
map.setCenter(latlngbounds.getCenter(),map.getBoundsZoomLevel(latlngbounds));
For further reference:
http://911-need-code-help.blogspot.com/2009/03/zoom-to-fit-all-markers-polylines-or.html
0 comments:
Post a Comment