MrGlasspoole
MrGlasspoole

Reputation: 445

Google Maps direction results not changing after adress change

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:

http://pastie.org/2001742

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

Answers (1)

Ryan Olds
Ryan Olds

Reputation: 4847

Keep a reference to the previous DirectionsRenderer and call .setMap(null) when you want to disabled it.

Upvotes: 1

Related Questions