openlayer4中如何移除地图中一个元素
由于初接触openlayers 需要记录下路上的小坑
this.featureLayer.getSource().getFeatures().forEach(function(feature){
if(feature.getProperties().featureInfo.deviceCode=="abc"){
this.featureLayer.getSource().removeFeature(feature);
}
})
注:通过feature图层数据源得到feature
转载自:https://blog.csdn.net/ZillahV06/article/details/80449044