Add ol.source.Vector#forEachFeature function

This commit is contained in:
Frederic Junod
2013-11-27 12:09:50 +01:00
parent 8f361e35dd
commit a3b43f21e4
2 changed files with 12 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
@exportClass ol.source.Vector ol.source.VectorOptions
@exportProperty ol.source.Vector.prototype.addFeature
@exportProperty ol.source.Vector.prototype.forEachFeature
@exportProperty ol.source.Vector.prototype.getAllFeaturesAtCoordinate

View File

@@ -68,6 +68,17 @@ ol.source.Vector.prototype.addFeature = function(feature) {
};
/**
* @param {function(this: T, ol.Feature): S} f Callback.
* @param {T=} opt_obj The object to be used a the value of 'this' within f.
* @return {S|undefined}
* @template T,S
*/
ol.source.Vector.prototype.forEachFeature = function(f, opt_obj) {
return this.rBush_.forEach(f, opt_obj);
};
/**
* @param {ol.Coordinate} coordinate Coordinate.
* @param {function(this: T, ol.Feature): S} f Callback.