Rename _ol_MapBrowserEventType_ to MapBrowserEventType

This commit is contained in:
Marc Jansen
2017-12-15 09:43:26 +01:00
committed by Frederic Junod
parent 465c248572
commit 039bde29cc
9 changed files with 49 additions and 49 deletions

View File

@@ -2,7 +2,7 @@
* @module ol/interaction/DoubleClickZoom
*/
import {inherits} from '../index.js';
import _ol_MapBrowserEventType_ from '../MapBrowserEventType.js';
import MapBrowserEventType from '../MapBrowserEventType.js';
import _ol_interaction_Interaction_ from '../interaction/Interaction.js';
/**
@@ -50,7 +50,7 @@ inherits(_ol_interaction_DoubleClickZoom_, _ol_interaction_Interaction_);
_ol_interaction_DoubleClickZoom_.handleEvent = function(mapBrowserEvent) {
var stopEvent = false;
var browserEvent = mapBrowserEvent.originalEvent;
if (mapBrowserEvent.type == _ol_MapBrowserEventType_.DBLCLICK) {
if (mapBrowserEvent.type == MapBrowserEventType.DBLCLICK) {
var map = mapBrowserEvent.map;
var anchor = mapBrowserEvent.coordinate;
var delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;

View File

@@ -3,7 +3,7 @@
*/
import {inherits} from '../index.js';
import _ol_Feature_ from '../Feature.js';
import _ol_MapBrowserEventType_ from '../MapBrowserEventType.js';
import MapBrowserEventType from '../MapBrowserEventType.js';
import _ol_Object_ from '../Object.js';
import _ol_coordinate_ from '../coordinate.js';
import _ol_events_ from '../events.js';
@@ -325,16 +325,16 @@ _ol_interaction_Draw_.handleEvent = function(event) {
this.freehand_ = this.mode_ !== _ol_interaction_Draw_.Mode_.POINT && this.freehandCondition_(event);
var pass = true;
if (this.freehand_ &&
event.type === _ol_MapBrowserEventType_.POINTERDRAG &&
event.type === MapBrowserEventType.POINTERDRAG &&
this.sketchFeature_ !== null) {
this.addToDrawing_(event);
pass = false;
} else if (this.freehand_ &&
event.type === _ol_MapBrowserEventType_.POINTERDOWN) {
event.type === MapBrowserEventType.POINTERDOWN) {
pass = false;
} else if (event.type === _ol_MapBrowserEventType_.POINTERMOVE) {
} else if (event.type === MapBrowserEventType.POINTERMOVE) {
pass = this.handlePointerMove_(event);
} else if (event.type === _ol_MapBrowserEventType_.DBLCLICK) {
} else if (event.type === MapBrowserEventType.DBLCLICK) {
pass = false;
}
return _ol_interaction_Pointer_.handleEvent.call(this, event) && pass;

View File

@@ -3,7 +3,7 @@
*/
import {inherits} from '../index.js';
import _ol_Feature_ from '../Feature.js';
import _ol_MapBrowserEventType_ from '../MapBrowserEventType.js';
import MapBrowserEventType from '../MapBrowserEventType.js';
import _ol_MapBrowserPointerEvent_ from '../MapBrowserPointerEvent.js';
import _ol_coordinate_ from '../coordinate.js';
import Event from '../events/Event.js';
@@ -136,7 +136,7 @@ _ol_interaction_Extent_.handleEvent_ = function(mapBrowserEvent) {
return true;
}
//display pointer (if not dragging)
if (mapBrowserEvent.type == _ol_MapBrowserEventType_.POINTERMOVE && !this.handlingDownUpSequence) {
if (mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE && !this.handlingDownUpSequence) {
this.handlePointerMove_(mapBrowserEvent);
}
//call pointer to determine up/down/drag

View File

@@ -5,7 +5,7 @@ import {getUid, inherits} from '../index.js';
import _ol_Collection_ from '../Collection.js';
import _ol_CollectionEventType_ from '../CollectionEventType.js';
import _ol_Feature_ from '../Feature.js';
import _ol_MapBrowserEventType_ from '../MapBrowserEventType.js';
import MapBrowserEventType from '../MapBrowserEventType.js';
import _ol_MapBrowserPointerEvent_ from '../MapBrowserPointerEvent.js';
import _ol_array_ from '../array.js';
import _ol_coordinate_ from '../coordinate.js';
@@ -806,12 +806,12 @@ _ol_interaction_Modify_.handleEvent = function(mapBrowserEvent) {
var handled;
if (!mapBrowserEvent.map.getView().getInteracting() &&
mapBrowserEvent.type == _ol_MapBrowserEventType_.POINTERMOVE &&
mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE &&
!this.handlingDownUpSequence) {
this.handlePointerMove_(mapBrowserEvent);
}
if (this.vertexFeature_ && this.deleteCondition_(mapBrowserEvent)) {
if (mapBrowserEvent.type != _ol_MapBrowserEventType_.SINGLECLICK ||
if (mapBrowserEvent.type != MapBrowserEventType.SINGLECLICK ||
!this.ignoreNextSingleClick_) {
handled = this.removePoint();
} else {
@@ -819,7 +819,7 @@ _ol_interaction_Modify_.handleEvent = function(mapBrowserEvent) {
}
}
if (mapBrowserEvent.type == _ol_MapBrowserEventType_.SINGLECLICK) {
if (mapBrowserEvent.type == MapBrowserEventType.SINGLECLICK) {
this.ignoreNextSingleClick_ = false;
}
@@ -1026,7 +1026,7 @@ _ol_interaction_Modify_.prototype.insertVertex_ = function(segmentData, vertex)
* @api
*/
_ol_interaction_Modify_.prototype.removePoint = function() {
if (this.lastPointerEvent_ && this.lastPointerEvent_.type != _ol_MapBrowserEventType_.POINTERDRAG) {
if (this.lastPointerEvent_ && this.lastPointerEvent_.type != MapBrowserEventType.POINTERDRAG) {
var evt = this.lastPointerEvent_;
this.willModifyFeatures_(evt);
this.removeVertex_();

View File

@@ -3,7 +3,7 @@
*/
import {inherits, nullFunction} from '../index.js';
import {FALSE} from '../functions.js';
import _ol_MapBrowserEventType_ from '../MapBrowserEventType.js';
import MapBrowserEventType from '../MapBrowserEventType.js';
import _ol_MapBrowserPointerEvent_ from '../MapBrowserPointerEvent.js';
import _ol_interaction_Interaction_ from '../interaction/Interaction.js';
import _ol_obj_ from '../obj.js';
@@ -109,9 +109,9 @@ _ol_interaction_Pointer_.centroid = function(pointerEvents) {
*/
_ol_interaction_Pointer_.prototype.isPointerDraggingEvent_ = function(mapBrowserEvent) {
var type = mapBrowserEvent.type;
return type === _ol_MapBrowserEventType_.POINTERDOWN ||
type === _ol_MapBrowserEventType_.POINTERDRAG ||
type === _ol_MapBrowserEventType_.POINTERUP;
return type === MapBrowserEventType.POINTERDOWN ||
type === MapBrowserEventType.POINTERDRAG ||
type === MapBrowserEventType.POINTERUP;
};
@@ -124,10 +124,10 @@ _ol_interaction_Pointer_.prototype.updateTrackedPointers_ = function(mapBrowserE
var event = mapBrowserEvent.pointerEvent;
var id = event.pointerId.toString();
if (mapBrowserEvent.type == _ol_MapBrowserEventType_.POINTERUP) {
if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {
delete this.trackedPointers_[id];
} else if (mapBrowserEvent.type ==
_ol_MapBrowserEventType_.POINTERDOWN) {
MapBrowserEventType.POINTERDOWN) {
this.trackedPointers_[id] = event;
} else if (id in this.trackedPointers_) {
// update only when there was a pointerdown event for this pointer
@@ -185,18 +185,18 @@ _ol_interaction_Pointer_.handleEvent = function(mapBrowserEvent) {
var stopEvent = false;
this.updateTrackedPointers_(mapBrowserEvent);
if (this.handlingDownUpSequence) {
if (mapBrowserEvent.type == _ol_MapBrowserEventType_.POINTERDRAG) {
if (mapBrowserEvent.type == MapBrowserEventType.POINTERDRAG) {
this.handleDragEvent_(mapBrowserEvent);
} else if (mapBrowserEvent.type == _ol_MapBrowserEventType_.POINTERUP) {
} else if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {
var handledUp = this.handleUpEvent_(mapBrowserEvent);
this.handlingDownUpSequence = handledUp && this.targetPointers.length > 0;
}
} else {
if (mapBrowserEvent.type == _ol_MapBrowserEventType_.POINTERDOWN) {
if (mapBrowserEvent.type == MapBrowserEventType.POINTERDOWN) {
var handled = this.handleDownEvent_(mapBrowserEvent);
this.handlingDownUpSequence = handled;
stopEvent = this.shouldStopEvent(handled);
} else if (mapBrowserEvent.type == _ol_MapBrowserEventType_.POINTERMOVE) {
} else if (mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE) {
this.handleMoveEvent_(mapBrowserEvent);
}
}