/ Published in: JavaScript
Borrowed from Jerome Paradis: http://blog.jeromeparadis.com
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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()); }
URL: http://blog.jeromeparadis.com/archive/2007/02/08/1468.aspx