Search code examples
javascriptgoogle-api-javascript-client

Deleting markers automaticaly created by Google directionsService


How can I delete all markers created by directionsService when using:

function calculateAndDisplayRoute(directionsService, directionsRenderer)

The example I´m working with is Waypoints in Directions se link bellow: https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints

Thanks a lot!


Solution

  • The question is solved not by deleting the markers, but making then invisible worked well, then I could go on and create own cool markers.