Search code examples
angulartomtom

How to remove markers from tomtom map for web application in angular 5?


I am using TomTom map for displaying vehicle on map in web application.

Actually I am done with the displaying vehicle on map but facing problem to remove markers which added on the map a screenshot is attached below.

Click here to see image

I already gone through the documentations of TomTom map but couldn't find any method.

For android they provided clear() method.

Is there is any method for remove markers from map in web application.

Thanks in advance


Solution

  • TomTom Maps SDK for Web is based on Open Source Leaflet. You can remove a marker using remove() method as mentioned in Leaflet Documentation

    So example:

    let marker1 = tomtom.L.marker([52.360306, 4.876935]).addTo(map);
    marker1.remove();