Refactoring to set the constraints to the map

This commit is contained in:
Éric Lemoine
2012-09-26 23:28:01 +02:00
parent 2991fa1178
commit b6bb05bf76
15 changed files with 164 additions and 178 deletions
+3 -5
View File
@@ -5,7 +5,6 @@ goog.provide('ol.interaction.ShiftDragZoom');
goog.require('ol.Extent');
goog.require('ol.MapBrowserEvent');
goog.require('ol.control.DragBox');
goog.require('ol.interaction.Constraints');
goog.require('ol.interaction.Drag');
@@ -27,10 +26,9 @@ ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS_SQUARED =
/**
* @constructor
* @extends {ol.interaction.Drag}
* @param {ol.interaction.Constraints} constraints Constraints.
*/
ol.interaction.ShiftDragZoom = function(constraints) {
goog.base(this, constraints);
ol.interaction.ShiftDragZoom = function() {
goog.base(this);
/**
* @type {ol.control.DragBox}
@@ -54,7 +52,7 @@ ol.interaction.ShiftDragZoom.prototype.handleDragEnd =
var extent = ol.Extent.boundingExtent(
this.startCoordinate,
mapBrowserEvent.getCoordinate());
this.fitExtent(map, extent);
map.fitExtent(extent);
}
};