replaced ol.Collection with Array

This commit is contained in:
Fran Peručić
2015-03-29 10:57:44 +02:00
parent 254039a6ab
commit 4b85f5737c
+4 -4
View File
@@ -68,10 +68,10 @@ ol.interaction.Snap = function(opt_options) {
this.features_ = goog.isDef(options.features) ? options.features : null; this.features_ = goog.isDef(options.features) ? options.features : null;
/** /**
* @type {ol.Collection.<goog.events.Key>} * @type {Array.<goog.events.Key>}
* @private * @private
*/ */
this.featuresListenerKeys_ = new ol.Collection(); this.featuresListenerKeys_ = [];
/** /**
* @type {Object.<number, goog.events.Key>} * @type {Object.<number, goog.events.Key>}
@@ -303,8 +303,8 @@ ol.interaction.Snap.prototype.setMap = function(map) {
var features = this.getFeatures_(); var features = this.getFeatures_();
if (currentMap) { if (currentMap) {
keys.forEach(ol.Observable.unByKey, this); goog.array.forEach(keys, ol.Observable.unByKey);
keys.clear(); keys.length = 0;
features.forEach(this.forEachFeatureRemove_, this); features.forEach(this.forEachFeatureRemove_, this);
} }