Я хочу удалить маркер на карте Openlayers. Как я могу удалить все маркеры, которые я добавил на карту
addmarker(name:any,lat:any,lng:any){
console.log("inside ",lat,lng,name)
var iconFeature = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.transform([lng,lat],'EPSG:4326', 'EPSG:3857')),
name: name
});
var iconStyle = new ol.style.Style({
image: new ol.style.Icon(({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.75,
src: '../../assets/images/location_pin.png'
}))
});
iconFeature.setStyle(iconStyle);
var vectorSource = new ol.source.Vector({
features: [iconFeature]
});
this.vector = vectorSource
var vectorLayer = new ol.layer.Vector({
source: vectorSource
});
this.vector_layer = vectorLayer
this.map.addLayer(vectorLayer);
}
Может кто-нибудь помочь мне удалить маркер, который я добавил в открытые слои?карта