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 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