Reputation: 445
i mix geolocation and a form input for a route planner. After changing the adress in the form or using geolocation the map works great. But the directions in the directionsDisplay.setPanel are not changing :-(
Heres my code:
EDIT: i just realised that i get the new directions. But the old directions are not deleted. They show up one below the other...
Upvotes: 0
Views: 284
Reputation: 4847
Keep a reference to the previous DirectionsRenderer and call .setMap(null) when you want to disabled it.
Upvotes: 1