diff --git a/src/ol/interaction/doubleclickzoominteraction.js b/src/ol/interaction/doubleclickzoominteraction.js index 1d9a087e7d..ffae0a057a 100644 --- a/src/ol/interaction/doubleclickzoominteraction.js +++ b/src/ol/interaction/doubleclickzoominteraction.js @@ -52,6 +52,5 @@ ol.interaction.DoubleClickZoom.prototype.handleMapBrowserEvent = ol.interaction.Interaction.zoomByDelta(map, view, delta, anchor, ol.interaction.DOUBLECLICKZOOM_ANIMATION_DURATION); mapBrowserEvent.preventDefault(); - browserEvent.preventDefault(); } }; diff --git a/src/ol/interaction/keyboardpaninteraction.js b/src/ol/interaction/keyboardpaninteraction.js index d5f6fc9a93..ce57d6ddcc 100644 --- a/src/ol/interaction/keyboardpaninteraction.js +++ b/src/ol/interaction/keyboardpaninteraction.js @@ -81,7 +81,6 @@ ol.interaction.KeyboardPan.prototype.handleMapBrowserEvent = ol.coordinate.rotate(delta, rotation); ol.interaction.Interaction.pan( map, view, delta, ol.interaction.KEYBOARD_PAN_DURATION); - keyEvent.preventDefault(); mapBrowserEvent.preventDefault(); } } diff --git a/src/ol/interaction/keyboardzoominteraction.js b/src/ol/interaction/keyboardzoominteraction.js index 8bd6cc8748..3096b95a94 100644 --- a/src/ol/interaction/keyboardzoominteraction.js +++ b/src/ol/interaction/keyboardzoominteraction.js @@ -62,7 +62,6 @@ ol.interaction.KeyboardZoom.prototype.handleMapBrowserEvent = var view = map.getView().getView2D(); ol.interaction.Interaction.zoomByDelta(map, view, delta, undefined, ol.interaction.KEYBOARD_ZOOM_DURATION); - keyEvent.preventDefault(); mapBrowserEvent.preventDefault(); } } diff --git a/src/ol/interaction/mousewheelzoominteraction.js b/src/ol/interaction/mousewheelzoominteraction.js index 25d5bcbe42..a23ade23a4 100644 --- a/src/ol/interaction/mousewheelzoominteraction.js +++ b/src/ol/interaction/mousewheelzoominteraction.js @@ -93,7 +93,6 @@ ol.interaction.MouseWheelZoom.prototype.handleMapBrowserEvent = goog.bind(this.doZoom_, this, map), timeLeft); mapBrowserEvent.preventDefault(); - mouseWheelEvent.preventDefault(); } }; diff --git a/src/ol/mapbrowserevent.exports b/src/ol/mapbrowserevent.exports index 4d2e9d2e5f..86297f9067 100644 --- a/src/ol/mapbrowserevent.exports +++ b/src/ol/mapbrowserevent.exports @@ -1,2 +1,4 @@ @exportProperty ol.MapBrowserEvent.prototype.getCoordinate @exportProperty ol.MapBrowserEvent.prototype.getPixel +@exportProperty ol.MapBrowserEvent.prototype.preventDefault +@exportProperty ol.MapBrowserEvent.prototype.stopPropagation diff --git a/src/ol/mapbrowserevent.js b/src/ol/mapbrowserevent.js index dae9c0119b..bea207c085 100644 --- a/src/ol/mapbrowserevent.js +++ b/src/ol/mapbrowserevent.js @@ -98,6 +98,24 @@ ol.MapBrowserEvent.prototype.isMouseActionButton = function() { }; +/** + * @override + */ +ol.MapBrowserEvent.prototype.preventDefault = function() { + goog.base(this, 'preventDefault'); + this.browserEvent.preventDefault(); +}; + + +/** + * @override + */ +ol.MapBrowserEvent.prototype.stopPropagation = function() { + goog.base(this, 'stopPropagation'); + this.browserEvent.stopPropagation(); +}; + + /** * @param {ol.Map} map The map with the viewport to listen to events on.