Changing Direction/Route Line Color

7,548 views
Skip to first unread message

Cam

unread,
Jan 8, 2010, 4:46:45 PM1/8/10
to Google Maps JavaScript API v3
By default, when a route/direction is rendered within the map the line
between the two points is blue. Is it possible to change the color to
something other than blue?

BTW - I'm rendering multiple routes on a single map and I need each
route/direction line to display a different color.

Thanks!

Daniel Lee

unread,
Jan 8, 2010, 6:23:07 PM1/8/10
to google-map...@googlegroups.com
We don't currently expose the Polyline objects generated by DirectionsRenderer which would be the easiest way to update the polyline style.  This feature is currently in the pipeline:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=1904

One workaround would be to create your own Polyline objects using the lat_lngs within each DirectionStep.  However, I foresee major performance issues with it.

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.






--
Daniel Lee
Developer Programs Engineer
Google, Inc.
345 Spear Street
San Francisco, CA 94105
650 253 0967
Reply all
Reply to author
Forward
0 new messages