Remove skippeFeatures collection

This commit is contained in:
Éric Lemoine
2014-04-24 20:58:50 +02:00
parent cd878e0ef8
commit f9c0f12f23
2 changed files with 24 additions and 54 deletions

View File

@@ -184,16 +184,12 @@ ol.interaction.Select.prototype.setMap = function(map) {
var currentMap = this.getMap();
var selectedFeatures = this.featureOverlay_.getFeatures();
if (!goog.isNull(currentMap)) {
selectedFeatures.forEach(function(feature) {
currentMap.getSkippedFeatures().remove(feature);
});
selectedFeatures.forEach(currentMap.unskipFeature, currentMap);
}
goog.base(this, 'setMap', map);
this.featureOverlay_.setMap(map);
if (!goog.isNull(map)) {
selectedFeatures.forEach(function(feature) {
map.getSkippedFeatures().push(feature);
});
selectedFeatures.forEach(map.skipFeature, map);
}
};
@@ -223,7 +219,7 @@ ol.interaction.Select.prototype.addFeature_ = function(evt) {
var map = this.getMap();
goog.asserts.assertInstanceof(feature, ol.Feature);
if (!goog.isNull(map)) {
map.getSkippedFeatures().push(feature);
map.skipFeature(feature);
}
};
@@ -237,6 +233,6 @@ ol.interaction.Select.prototype.removeFeature_ = function(evt) {
var map = this.getMap();
goog.asserts.assertInstanceof(feature, ol.Feature);
if (!goog.isNull(map)) {
map.getSkippedFeatures().remove(feature);
map.unskipFeature(feature);
}
};