Rename _ol_events_EventType_ to EventType
This commit is contained in:
committed by
Frederic Junod
parent
ec64789940
commit
479c7a4668
@@ -7,7 +7,7 @@ import {inherits} from '../index.js';
|
||||
import {TRUE} from '../functions.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import Event from '../events/Event.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import _ol_interaction_Interaction_ from '../interaction/Interaction.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
|
||||
@@ -77,7 +77,7 @@ _ol_interaction_DragAndDrop_.handleDrop_ = function(event) {
|
||||
for (i = 0, ii = files.length; i < ii; ++i) {
|
||||
file = files.item(i);
|
||||
var reader = new FileReader();
|
||||
reader.addEventListener(_ol_events_EventType_.LOAD,
|
||||
reader.addEventListener(EventType.LOAD,
|
||||
this.handleResult_.bind(this, file));
|
||||
reader.readAsText(file);
|
||||
}
|
||||
@@ -159,13 +159,13 @@ _ol_interaction_DragAndDrop_.prototype.registerListeners_ = function() {
|
||||
if (map) {
|
||||
var dropArea = this.target ? this.target : map.getViewport();
|
||||
this.dropListenKeys_ = [
|
||||
_ol_events_.listen(dropArea, _ol_events_EventType_.DROP,
|
||||
_ol_events_.listen(dropArea, EventType.DROP,
|
||||
_ol_interaction_DragAndDrop_.handleDrop_, this),
|
||||
_ol_events_.listen(dropArea, _ol_events_EventType_.DRAGENTER,
|
||||
_ol_events_.listen(dropArea, EventType.DRAGENTER,
|
||||
_ol_interaction_DragAndDrop_.handleStop_, this),
|
||||
_ol_events_.listen(dropArea, _ol_events_EventType_.DRAGOVER,
|
||||
_ol_events_.listen(dropArea, EventType.DRAGOVER,
|
||||
_ol_interaction_DragAndDrop_.handleStop_, this),
|
||||
_ol_events_.listen(dropArea, _ol_events_EventType_.DROP,
|
||||
_ol_events_.listen(dropArea, EventType.DROP,
|
||||
_ol_interaction_DragAndDrop_.handleStop_, this)
|
||||
];
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_coordinate_ from '../coordinate.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import _ol_events_KeyCode_ from '../events/KeyCode.js';
|
||||
import _ol_events_condition_ from '../events/condition.js';
|
||||
import _ol_interaction_Interaction_ from '../interaction/Interaction.js';
|
||||
@@ -78,7 +78,7 @@ inherits(_ol_interaction_KeyboardPan_, _ol_interaction_Interaction_);
|
||||
*/
|
||||
_ol_interaction_KeyboardPan_.handleEvent = function(mapBrowserEvent) {
|
||||
var stopEvent = false;
|
||||
if (mapBrowserEvent.type == _ol_events_EventType_.KEYDOWN) {
|
||||
if (mapBrowserEvent.type == EventType.KEYDOWN) {
|
||||
var keyEvent = mapBrowserEvent.originalEvent;
|
||||
var keyCode = keyEvent.keyCode;
|
||||
if (this.condition_(mapBrowserEvent) &&
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/interaction/KeyboardZoom
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import _ol_events_condition_ from '../events/condition.js';
|
||||
import _ol_interaction_Interaction_ from '../interaction/Interaction.js';
|
||||
|
||||
@@ -66,8 +66,8 @@ inherits(_ol_interaction_KeyboardZoom_, _ol_interaction_Interaction_);
|
||||
*/
|
||||
_ol_interaction_KeyboardZoom_.handleEvent = function(mapBrowserEvent) {
|
||||
var stopEvent = false;
|
||||
if (mapBrowserEvent.type == _ol_events_EventType_.KEYDOWN ||
|
||||
mapBrowserEvent.type == _ol_events_EventType_.KEYPRESS) {
|
||||
if (mapBrowserEvent.type == EventType.KEYDOWN ||
|
||||
mapBrowserEvent.type == EventType.KEYPRESS) {
|
||||
var keyEvent = mapBrowserEvent.originalEvent;
|
||||
var charCode = keyEvent.charCode;
|
||||
if (this.condition_(mapBrowserEvent) &&
|
||||
|
||||
@@ -11,7 +11,7 @@ import _ol_array_ from '../array.js';
|
||||
import _ol_coordinate_ from '../coordinate.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import Event from '../events/Event.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import _ol_events_condition_ from '../events/condition.js';
|
||||
import {boundingExtent, buffer, createOrUpdateFromCoordinate} from '../extent.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
@@ -256,7 +256,7 @@ _ol_interaction_Modify_.prototype.addFeature_ = function(feature) {
|
||||
if (map && map.isRendered() && this.getActive()) {
|
||||
this.handlePointerAtPixel_(this.lastPixel_, map);
|
||||
}
|
||||
_ol_events_.listen(feature, _ol_events_EventType_.CHANGE,
|
||||
_ol_events_.listen(feature, EventType.CHANGE,
|
||||
this.handleFeatureChange_, this);
|
||||
};
|
||||
|
||||
@@ -286,7 +286,7 @@ _ol_interaction_Modify_.prototype.removeFeature_ = function(feature) {
|
||||
this.overlay_.getSource().removeFeature(this.vertexFeature_);
|
||||
this.vertexFeature_ = null;
|
||||
}
|
||||
_ol_events_.unlisten(feature, _ol_events_EventType_.CHANGE,
|
||||
_ol_events_.unlisten(feature, EventType.CHANGE,
|
||||
this.handleFeatureChange_, this);
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_ViewHint_ from '../ViewHint.js';
|
||||
import {easeOut} from '../easing.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import _ol_has_ from '../has.js';
|
||||
import _ol_interaction_Interaction_ from '../interaction/Interaction.js';
|
||||
import _ol_math_ from '../math.js';
|
||||
@@ -128,7 +128,7 @@ inherits(_ol_interaction_MouseWheelZoom_, _ol_interaction_Interaction_);
|
||||
*/
|
||||
_ol_interaction_MouseWheelZoom_.handleEvent = function(mapBrowserEvent) {
|
||||
var type = mapBrowserEvent.type;
|
||||
if (type !== _ol_events_EventType_.WHEEL && type !== _ol_events_EventType_.MOUSEWHEEL) {
|
||||
if (type !== EventType.WHEEL && type !== EventType.MOUSEWHEEL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ _ol_interaction_MouseWheelZoom_.handleEvent = function(mapBrowserEvent) {
|
||||
// Delta normalisation inspired by
|
||||
// https://github.com/mapbox/mapbox-gl-js/blob/001c7b9/js/ui/handler/scroll_zoom.js
|
||||
var delta;
|
||||
if (mapBrowserEvent.type == _ol_events_EventType_.WHEEL) {
|
||||
if (mapBrowserEvent.type == EventType.WHEEL) {
|
||||
delta = wheelEvent.deltaY;
|
||||
if (_ol_has_.FIREFOX &&
|
||||
wheelEvent.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {
|
||||
@@ -153,7 +153,7 @@ _ol_interaction_MouseWheelZoom_.handleEvent = function(mapBrowserEvent) {
|
||||
if (wheelEvent.deltaMode === WheelEvent.DOM_DELTA_LINE) {
|
||||
delta *= 40;
|
||||
}
|
||||
} else if (mapBrowserEvent.type == _ol_events_EventType_.MOUSEWHEEL) {
|
||||
} else if (mapBrowserEvent.type == EventType.MOUSEWHEEL) {
|
||||
delta = -wheelEvent.wheelDeltaY;
|
||||
if (_ol_has_.SAFARI) {
|
||||
delta /= 3;
|
||||
|
||||
@@ -6,7 +6,7 @@ import _ol_Collection_ from '../Collection.js';
|
||||
import _ol_CollectionEventType_ from '../CollectionEventType.js';
|
||||
import _ol_coordinate_ from '../coordinate.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {boundingExtent, createEmpty} from '../extent.js';
|
||||
import {TRUE, FALSE} from '../functions.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
@@ -174,7 +174,7 @@ _ol_interaction_Snap_.prototype.addFeature = function(feature, opt_listen) {
|
||||
if (listen) {
|
||||
this.featureChangeListenerKeys_[feature_uid] = _ol_events_.listen(
|
||||
feature,
|
||||
_ol_events_EventType_.CHANGE,
|
||||
EventType.CHANGE,
|
||||
this.handleFeatureChange_, this);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user