diff --git a/lib/OpenLayers/Control/ZoomBox.js b/lib/OpenLayers/Control/ZoomBox.js index 202f474fd6..c83ed80b3b 100644 --- a/lib/OpenLayers/Control/ZoomBox.js +++ b/lib/OpenLayers/Control/ZoomBox.js @@ -54,7 +54,7 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, { var pixHeight = Math.abs(position.top-position.bottom); var zoomFactor = Math.min((this.map.size.h / pixHeight), (this.map.size.w / pixWidth)); - var extent = map.getExtent(); + var extent = this.map.getExtent(); var center = this.map.getLonLatFromPixel( position.getCenterPixel()); var xmin = center.lon - (extent.getWidth()/2)*zoomFactor;