base dragrotateandzoominteraction on pointer interaction

This commit is contained in:
tsauerwein
2014-02-26 15:24:17 +01:00
parent c593add6d8
commit 56dcdd02ec
2 changed files with 47 additions and 6 deletions

View File

@@ -136,6 +136,7 @@ ol.interaction.PointerInteraction.prototype.handleMapBrowserEvent =
var mapBrowserPointerEvent =
/** @type {ol.MapBrowserPointerEvent} */ (mapBrowserEvent);
var stopEvent = false;
var view = mapBrowserEvent.map.getView();
this.updateTrackedPointers_(mapBrowserPointerEvent);
if (this.handled_) {
@@ -156,6 +157,20 @@ ol.interaction.PointerInteraction.prototype.handleMapBrowserEvent =
view.setHint(ol.ViewHint.INTERACTING, 1);
}
this.handled_ = handled;
stopEvent = this.shouldStopEvent(handled);
}
return true;
return !stopEvent;
};
/**
* This method allows inheriting classes to stop the event from being
* passed to further interactions. For example, this is required for
* interaction `DragRotateAndZoom`.
*
* @protected
* @param {boolean} handled Was the event handled by the interaction?
* @return {boolean} Should the event be stopped?
*/
ol.interaction.PointerInteraction.prototype.shouldStopEvent =
goog.functions.FALSE;