Named exports from ol/events

This commit is contained in:
Tim Schaub
2018-01-24 10:09:57 -07:00
parent 1786bbbe80
commit 7e7631c42a
74 changed files with 437 additions and 445 deletions

View File

@@ -8,7 +8,7 @@ import CollectionEventType from '../CollectionEventType.js';
import ObjectEventType from '../ObjectEventType.js';
import {extend} from '../array.js';
import {assert} from '../asserts.js';
import _ol_events_ from '../events.js';
import {listen, unlistenByKey} from '../events.js';
import Event from '../events/Event.js';
import EventType from '../events/EventType.js';
import {containsExtent, equals} from '../extent.js';
@@ -203,9 +203,9 @@ VectorSource.prototype.addFeatureInternal = function(feature) {
*/
VectorSource.prototype.setupChangeEvents_ = function(featureKey, feature) {
this.featureChangeKeys_[featureKey] = [
_ol_events_.listen(feature, EventType.CHANGE,
listen(feature, EventType.CHANGE,
this.handleFeatureChange_, this),
_ol_events_.listen(feature, ObjectEventType.PROPERTYCHANGE,
listen(feature, ObjectEventType.PROPERTYCHANGE,
this.handleFeatureChange_, this)
];
};
@@ -295,7 +295,7 @@ VectorSource.prototype.addFeaturesInternal = function(features) {
*/
VectorSource.prototype.bindFeaturesCollection_ = function(collection) {
let modifyingCollection = false;
_ol_events_.listen(this, VectorEventType.ADDFEATURE,
listen(this, VectorEventType.ADDFEATURE,
function(evt) {
if (!modifyingCollection) {
modifyingCollection = true;
@@ -303,7 +303,7 @@ VectorSource.prototype.bindFeaturesCollection_ = function(collection) {
modifyingCollection = false;
}
});
_ol_events_.listen(this, VectorEventType.REMOVEFEATURE,
listen(this, VectorEventType.REMOVEFEATURE,
function(evt) {
if (!modifyingCollection) {
modifyingCollection = true;
@@ -311,7 +311,7 @@ VectorSource.prototype.bindFeaturesCollection_ = function(collection) {
modifyingCollection = false;
}
});
_ol_events_.listen(collection, CollectionEventType.ADD,
listen(collection, CollectionEventType.ADD,
function(evt) {
if (!modifyingCollection) {
modifyingCollection = true;
@@ -319,7 +319,7 @@ VectorSource.prototype.bindFeaturesCollection_ = function(collection) {
modifyingCollection = false;
}
}, this);
_ol_events_.listen(collection, CollectionEventType.REMOVE,
listen(collection, CollectionEventType.REMOVE,
function(evt) {
if (!modifyingCollection) {
modifyingCollection = true;
@@ -340,7 +340,7 @@ VectorSource.prototype.clear = function(opt_fast) {
if (opt_fast) {
for (const featureId in this.featureChangeKeys_) {
const keys = this.featureChangeKeys_[featureId];
keys.forEach(_ol_events_.unlistenByKey);
keys.forEach(unlistenByKey);
}
if (!this.featuresCollection_) {
this.featureChangeKeys_ = {};
@@ -798,7 +798,7 @@ VectorSource.prototype.removeFeature = function(feature) {
*/
VectorSource.prototype.removeFeatureInternal = function(feature) {
const featureKey = getUid(feature).toString();
this.featureChangeKeys_[featureKey].forEach(_ol_events_.unlistenByKey);
this.featureChangeKeys_[featureKey].forEach(unlistenByKey);
delete this.featureChangeKeys_[featureKey];
const id = feature.getId();
if (id !== undefined) {