Revert "Replace the navigation control by two controls, namely DragPan and MouseWheelZoom. DragPan is the map default drag control. MouseWheelZoom is the map default mouse wheel control."
This reverts commit c2a30f4ac4.
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
* Provides a class for listening to drag sequences on a DOM element and
|
||||
* dispatching dragstart, drag and dragend events to a map object.
|
||||
*
|
||||
* Calls handleDragEvent on the map if default is not prevented by
|
||||
* listeners.
|
||||
* The default behavior for the drag event is moving the map.
|
||||
*/
|
||||
|
||||
goog.provide('ol.handler.Drag');
|
||||
@@ -102,7 +101,10 @@ ol.handler.Drag.prototype.handleDrag = function(e) {
|
||||
this.prevY_ = e.clientY;
|
||||
var rt = goog.events.dispatchEvent(this.map_, newE);
|
||||
if (rt) {
|
||||
this.map_.handleDragEvent(newE);
|
||||
var defaultControl = this.map_.getDefaultControl();
|
||||
if (defaultControl) {
|
||||
defaultControl.defaultDrag(newE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
* Provides a class for listening to mousewheel events on a DOM element
|
||||
* and dispatching mousewheel events to a map instance.
|
||||
*
|
||||
* Calls handleMouseWheelEvent on the map if default is not prevented by
|
||||
* listeners.
|
||||
* The default behavior for the mousewheel event is zooming the map.
|
||||
*/
|
||||
|
||||
goog.provide('ol.handler.MouseWheel');
|
||||
@@ -48,6 +47,9 @@ ol.handler.MouseWheel.prototype.handleMouseWheel = function(e) {
|
||||
var newE = new ol.events.MapEvent(ol.events.MapEventType.MOUSEWHEEL, e);
|
||||
var rt = goog.events.dispatchEvent(this.map_, newE);
|
||||
if (rt) {
|
||||
this.map_.handleMouseWheelEvent(newE);
|
||||
var defaultControl = this.map_.getDefaultControl();
|
||||
if (defaultControl) {
|
||||
defaultControl.defaultMouseWheel(newE);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user