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