Removing directions from google-map

26 views
Skip to first unread message

Paul Rondeau

unread,
Jul 23, 2015, 11:55:05 AM7/23/15
to Polymer
Hi, 

I was wondering if it is possible to remove or change google-map-directions once drawn on a google-map element?

Currently I have something like in the screenshot provided. But if I want to let the user try another route is there a way to do this without reloading the page?

I've tried manually modifying the Light dom with no success: 

    Polymer.dom(parent).removeChild('google-map-directions');


Thanks,
Paul
Screen Shot 2015-07-23 at 11.43.06 AM.png

Eric Bidelman

unread,
Jul 23, 2015, 5:03:24 PM7/23/15
to Paul Rondeau, Polymer
According to the Maps API, you have to clear the map on the directionsRenderer. For the element, that's something like:

<google-directions>.directionsRenderer.setMap(null);


Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/4e3535b8-78bd-4ed9-b762-124f079fac7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Rondeau

unread,
Jul 23, 2015, 5:06:53 PM7/23/15
to Polymer, ebi...@gmail.com
Oh I see, that worked exactly as I wanted. Thanks! 
Reply all
Reply to author
Forward
0 new messages