Clearing Directions route

3,656 views
Skip to first unread message

PeteV

unread,
Nov 10, 2009, 1:10:37 AM11/10/09
to Google Maps JavaScript API v3
Hi there,

I have been developing an application using API 3 for some time now,
and have 1 last bit of functionality to achieve. I have no live
webpage to post, however my question is highlevel in nature and API
related

Is there a way to "clear" a directional route after it's been created
(i.e. using directionsService.route)

Similar to the the http://www.lootogo.com/googlemapsapi3/markerPlugin.html
function for markers, however to remove the polyline drawing on the
map?

Thanks in advance

Esa

unread,
Nov 10, 2009, 9:28:45 AM11/10/09
to Google Maps JavaScript API v3
.setMap(null) method of DirectionsRenderer clears the markers and
polygons created by DirectionsRenderer.

PeteV

unread,
Nov 10, 2009, 5:31:16 PM11/10/09
to Google Maps JavaScript API v3
I knew I was over-complicating it. Thank you kindly.
Reply all
Reply to author
Forward
0 new messages