Merge pull request #4736 from ahocevar/fix-select

Properly detect feature on unmanaged layer for toggle selection
This commit is contained in:
Andreas Hocevar
2016-02-02 08:58:16 +01:00
3 changed files with 45 additions and 2 deletions

View File

@@ -739,6 +739,16 @@ ol.source.Vector.prototype.handleFeatureChange_ = function(event) {
};
/**
* @param {ol.Feature} feature Feature.
* @return {boolean} Feature is in source.
*/
ol.source.Vector.prototype.hasFeature = function(feature) {
var id = feature.getId();
return id ? id in this.idIndex_ : goog.getUid(feature) in this.undefIdIndex_;
};
/**
* @return {boolean} Is empty.
*/