Merge pull request #1940 from ahocevar/select-setmap
Handle skipped features when setting the map
This commit is contained in:
@@ -179,8 +179,20 @@ ol.interaction.Select.prototype.handleMapBrowserEvent =
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.interaction.Select.prototype.setMap = function(map) {
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
goog.base(this, 'setMap', map);
|
goog.base(this, 'setMap', map);
|
||||||
this.featureOverlay_.setMap(map);
|
this.featureOverlay_.setMap(map);
|
||||||
|
if (!goog.isNull(map)) {
|
||||||
|
selectedFeatures.forEach(function(feature) {
|
||||||
|
map.getSkippedFeatures().push(feature);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user