Dedicated module for collection event type enum

This commit is contained in:
Tim Schaub
2016-12-27 12:31:50 -07:00
parent 828e26ea81
commit 847efde217
9 changed files with 61 additions and 55 deletions

View File

@@ -1,7 +1,7 @@
goog.provide('ol.interaction.Modify');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.CollectionEventType');
goog.require('ol.Feature');
goog.require('ol.MapBrowserEvent');
goog.require('ol.MapBrowserPointerEvent');
@@ -173,9 +173,9 @@ ol.interaction.Modify = function(options) {
this.features_ = options.features;
this.features_.forEach(this.addFeature_, this);
ol.events.listen(this.features_, ol.Collection.EventType.ADD,
ol.events.listen(this.features_, ol.CollectionEventType.ADD,
this.handleFeatureAdd_, this);
ol.events.listen(this.features_, ol.Collection.EventType.REMOVE,
ol.events.listen(this.features_, ol.CollectionEventType.REMOVE,
this.handleFeatureRemove_, this);
/**

View File

@@ -1,12 +1,12 @@
goog.provide('ol.interaction.Select');
goog.require('ol');
goog.require('ol.functions');
goog.require('ol.Collection');
goog.require('ol.CollectionEventType');
goog.require('ol.array');
goog.require('ol.events');
goog.require('ol.events.Event');
goog.require('ol.events.condition');
goog.require('ol.functions');
goog.require('ol.geom.GeometryType');
goog.require('ol.interaction.Interaction');
goog.require('ol.layer.Vector');
@@ -136,9 +136,9 @@ ol.interaction.Select = function(opt_options) {
this.featureLayerAssociation_ = {};
var features = this.featureOverlay_.getSource().getFeaturesCollection();
ol.events.listen(features, ol.Collection.EventType.ADD,
ol.events.listen(features, ol.CollectionEventType.ADD,
this.addFeature_, this);
ol.events.listen(features, ol.Collection.EventType.REMOVE,
ol.events.listen(features, ol.CollectionEventType.REMOVE,
this.removeFeature_, this);
};

View File

@@ -2,6 +2,7 @@ goog.provide('ol.interaction.Snap');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.CollectionEventType');
goog.require('ol.Object');
goog.require('ol.Observable');
goog.require('ol.coordinate');
@@ -335,9 +336,9 @@ ol.interaction.Snap.prototype.setMap = function(map) {
if (map) {
if (this.features_) {
keys.push(
ol.events.listen(this.features_, ol.Collection.EventType.ADD,
ol.events.listen(this.features_, ol.CollectionEventType.ADD,
this.handleFeatureAdd_, this),
ol.events.listen(this.features_, ol.Collection.EventType.REMOVE,
ol.events.listen(this.features_, ol.CollectionEventType.REMOVE,
this.handleFeatureRemove_, this)
);
} else if (this.source_) {