MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / getFeatures

Method getFeatures

src/mapboxgl/overlay/theme/ThemeLayer.js:297–306  ·  view source on GitHub ↗

* @function ThemeLayer.prototype.getFeatures * @description 查看当前图层中的有效数据。 * @param {Function} [filter] - 根据条件过滤要素的回调函数。 * @returns {Array. } 用户加入图层的有效数据。

(filter)

Source from the content-addressed store, hash-verified

295 * @returns {Array.<FeatureVector>} 用户加入图层的有效数据。
296 */
297 getFeatures(filter) {
298 var len = this.features.length;
299 var clonedFeatures = [];
300 for (var i = 0; i < len; ++i) {
301 if (!filter || (filter && typeof filter === 'function' && filter(this.features[i]))) {
302 clonedFeatures.push(this.features[i]);
303 }
304 }
305 return clonedFeatures;
306 }
307
308 /**
309 * @function ThemeLayer.prototype.getFeatureBy

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
filterFunction · 0.50

Tested by

no test coverage detected