Remove the box also if we don't zoom

This commit is contained in:
ahocevar
2012-09-26 13:03:09 +02:00
parent e7063953d7
commit bdd8a75123

View File

@@ -46,14 +46,14 @@ goog.inherits(ol.interaction.ShiftDragZoom, ol.interaction.Drag);
*/
ol.interaction.ShiftDragZoom.prototype.handleDragEnd =
function(mapBrowserEvent) {
goog.dispose(this.dragBox_);
this.dragBox_ = null;
if (this.deltaX * this.deltaX + this.deltaY * this.deltaY >=
ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS_SQUARED) {
var map = mapBrowserEvent.map;
var extent = ol.Extent.boundingExtent(
this.startCoordinate,
mapBrowserEvent.getCoordinate());
goog.dispose(this.dragBox_);
this.dragBox_ = null;
this.fitExtent(map, extent);
}
};