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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user