Remove the box also if we don't zoom
This commit is contained in:
@@ -46,14 +46,14 @@ goog.inherits(ol.interaction.ShiftDragZoom, ol.interaction.Drag);
|
|||||||
*/
|
*/
|
||||||
ol.interaction.ShiftDragZoom.prototype.handleDragEnd =
|
ol.interaction.ShiftDragZoom.prototype.handleDragEnd =
|
||||||
function(mapBrowserEvent) {
|
function(mapBrowserEvent) {
|
||||||
|
goog.dispose(this.dragBox_);
|
||||||
|
this.dragBox_ = null;
|
||||||
if (this.deltaX * this.deltaX + this.deltaY * this.deltaY >=
|
if (this.deltaX * this.deltaX + this.deltaY * this.deltaY >=
|
||||||
ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS_SQUARED) {
|
ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS_SQUARED) {
|
||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
var extent = ol.Extent.boundingExtent(
|
var extent = ol.Extent.boundingExtent(
|
||||||
this.startCoordinate,
|
this.startCoordinate,
|
||||||
mapBrowserEvent.getCoordinate());
|
mapBrowserEvent.getCoordinate());
|
||||||
goog.dispose(this.dragBox_);
|
|
||||||
this.dragBox_ = null;
|
|
||||||
this.fitExtent(map, extent);
|
this.fitExtent(map, extent);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user