Add handle*Event options to ol.interaction.Pointer
More specifically: handleDownEvent, handleDragEvent, handleMoveEvent, and handleUpEvent.
This commit is contained in:
@@ -86,7 +86,11 @@ goog.inherits(ol.DragBoxEvent, goog.events.Event);
|
||||
*/
|
||||
ol.interaction.DragBox = function(opt_options) {
|
||||
|
||||
goog.base(this);
|
||||
goog.base(this, {
|
||||
handleDownEvent: ol.interaction.DragBox.handleDownEvent_,
|
||||
handleDragEvent: ol.interaction.DragBox.handleDragEvent_,
|
||||
handleUpEvent: ol.interaction.DragBox.handleUpEvent_
|
||||
});
|
||||
|
||||
var options = goog.isDef(opt_options) ? opt_options : {};
|
||||
|
||||
@@ -120,9 +124,11 @@ goog.inherits(ol.interaction.DragBox, ol.interaction.Pointer);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @this {ol.interaction.DragBox}
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.DragBox.prototype.handlePointerDrag = function(mapBrowserEvent) {
|
||||
ol.interaction.DragBox.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
if (!ol.events.condition.mouseOnly(mapBrowserEvent)) {
|
||||
return;
|
||||
}
|
||||
@@ -143,6 +149,7 @@ ol.interaction.DragBox.prototype.getGeometry = function() {
|
||||
|
||||
/**
|
||||
* To be overriden by child classes.
|
||||
* FIXME: use constructor option instead of relying on overridding.
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @protected
|
||||
*/
|
||||
@@ -150,9 +157,12 @@ ol.interaction.DragBox.prototype.onBoxEnd = goog.nullFunction;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {ol.interaction.DragBox}
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.DragBox.prototype.handlePointerUp = function(mapBrowserEvent) {
|
||||
ol.interaction.DragBox.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
if (!ol.events.condition.mouseOnly(mapBrowserEvent)) {
|
||||
return true;
|
||||
}
|
||||
@@ -173,9 +183,12 @@ ol.interaction.DragBox.prototype.handlePointerUp = function(mapBrowserEvent) {
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {ol.interaction.DragBox}
|
||||
* @private
|
||||
*/
|
||||
ol.interaction.DragBox.prototype.handlePointerDown = function(mapBrowserEvent) {
|
||||
ol.interaction.DragBox.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
if (!ol.events.condition.mouseOnly(mapBrowserEvent)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user