Return to Snippet

Revision: 24863
at March 12, 2010 18:11 by Jamie


Initial Code
function fitMap( map, points ) {
   var bounds = new GLatLngBounds();
   for (var i=0; i< points.length; i++) {
      bounds.extend(points[i]);
   }
   map.setZoom(map.getBoundsZoomLevel(bounds));
   map.setCenter(bounds.getCenter());
}

Initial URL
http://blog.jeromeparadis.com/archive/2007/02/08/1468.aspx

Initial Description
Borrowed from Jerome Paradis: http://blog.jeromeparadis.com

Initial Title
Zoom to Markers in Google Maps API

Initial Tags
google, api

Initial Language
JavaScript