Applied Corey Puffault's zoomToExtent() patch from #107.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@789 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-06-27 04:42:17 +00:00
parent c92cd6d88a
commit fbbf1b317a

View File

@@ -552,6 +552,14 @@ OpenLayers.Map.prototype = {
);
},
zoomToExtent: function(bounds) {
this.setCenter(
new OpenLayers.LonLat((bounds.left+bounds.right)/2,
(bounds.bottom+bounds.top)/2),
this.getZoomForExtent(bounds)
);
},
/**
* @param {OpenLayers.LonLat} lonlat
* @private