react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

Change Routes on DirectionsRenderer

Open nathanqueija opened this issue 9 years ago • 5 comments

Hi, I would like to have a list of possible destinations and depending what destination user clicked the route would change accordind to curren destination. The best solutons for this is to pass the origin and destination as props to MapWithADirectionsRenderer (like the example on docs) ? Or is it possible to change routes inside the component with DirectionsService? Thanks!

nathanqueija avatar Sep 21 '17 19:09 nathanqueija

The best solutons for this is to pass the origin and destination as props to MapWithADirectionsRenderer

Yes

Or is it possible to change routes inside the component with DirectionsService?

You can try and let me know.

tomchentw avatar Oct 02 '17 15:10 tomchentw

Hey, @tomchentw I passed origin and destination as props and it worked. Thanks!

nathanqueija avatar Oct 02 '17 17:10 nathanqueija

Hey how did you pass origin and destination to the directions renderer?

ejswenson15 avatar Jan 04 '18 22:01 ejswenson15

using props…… https://tomchentw.github.io/react-google-maps/#!/DirectionsRenderer

tomchentw avatar Jan 05 '18 01:01 tomchentw

Hey how can i change styles of path line in DirectionsRenderer component?

swetha2 avatar Jul 23 '18 09:07 swetha2