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

Method removeData

src/openlayers/overlay/mapv/MapvLayer.js:249–262  ·  view source on GitHub ↗

* @function MapvLayer.prototype.removeData * @description 删除符合过滤条件的数据。 * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。

(filter)

Source from the content-addressed store, hash-verified

247 * @param {function} filter - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
248 */
249 removeData(filter) {
250 if (!this.dataSet) {
251 return;
252 }
253 var newData = this.dataSet.get({
254 filter: function (data) {
255 return (filter != null && typeof filter === "function") ? !filter(data) : true;
256 }
257 });
258 this.dataSet.set(newData);
259 this.update({
260 options: null
261 });
262 }
263
264 /**
265 * @function MapvLayer.prototype.clearData

Callers

nothing calls this directly

Calls 4

updateMethod · 0.95
filterFunction · 0.50
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected