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 commit is contained in:
@@ -4,7 +4,8 @@
|
||||
* Provides a class for listening to drag sequences on a DOM element and
|
||||
* dispatching dragstart, drag and dragend events to a map object.
|
||||
*
|
||||
* The default behavior for the drag event is moving the map.
|
||||
* Calls handleDragEvent on the map if default is not prevented by
|
||||
* listeners.
|
||||
*/
|
||||
|
||||
goog.provide('ol.handler.Drag');
|
||||
@@ -101,10 +102,7 @@ ol.handler.Drag.prototype.handleDrag = function(e) {
|
||||
this.prevY_ = e.clientY;
|
||||
var rt = goog.events.dispatchEvent(this.map_, newE);
|
||||
if (rt) {
|
||||
var defaultControl = this.map_.getDefaultControl();
|
||||
if (defaultControl) {
|
||||
defaultControl.defaultDrag(newE);
|
||||
}
|
||||
this.map_.handleDragEvent(newE);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
* Provides a class for listening to mousewheel events on a DOM element
|
||||
* and dispatching mousewheel events to a map instance.
|
||||
*
|
||||
* The default behavior for the mousewheel event is zooming the map.
|
||||
* Calls handleMouseWheelEvent on the map if default is not prevented by
|
||||
* listeners.
|
||||
*/
|
||||
|
||||
goog.provide('ol.handler.MouseWheel');
|
||||
@@ -47,9 +48,6 @@ 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) {
|
||||
var defaultControl = this.map_.getDefaultControl();
|
||||
if (defaultControl) {
|
||||
defaultControl.defaultMouseWheel(newE);
|
||||
}
|
||||
this.map_.handleMouseWheelEvent(newE);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user