Remove marker MapquestGl Map

2 posts / 0 new
Last post
atiqsayyed
Remove marker MapquestGl Map

Hi,

I'm creating a marker on map simply using this 

var map = new mqgl.Map('map', 'KEY', {
center: [-43.698637,42.300916],
zoom: 18,
bearing: 0,
pitch: 0,
style:"hybrid"
});

locations.forEach(function (feature, index) {

  var lat = feature.lat

  var lon = feature.lon

  map.icons.marker.addWithPopup({ lng: long, lat: lat }, iconName, propHtml);

})

Is there a way to clear all markers from the MAP??

Now I want to delete all the markers on the Map, I'm not able to find a way to do this, can anyone help me here??

 


MQNickZustak
To my knowledge, you have to
To my knowledge, you have to attach the markers to a layer (leaflet method) and remove the entire layer. Here are some examples: https://stackoverflow.com/questions/41256026/clear-marker-layers-leaflet  https://stackoverflow.com/questions/28636723/how-to-clear-leaflet-map-of...