diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 259175714c..fecd812fc2 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -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