I am creating app that display route between two endpoint,this is done.
But now i want to display more than on route between two end so how can i do that.I have checked on Google about &alternative=true can give alternative route i have tried it but does not do anything.
I am creating app that display route between two endpoint,this is done. But now
Share
the
alternatives-parameter is used for the directions-Webservice. This Service doesn’t display anything, it returns routes(when the alternative-parameter is set to true, he will return multiple routes when available), it’s on you to display the routes somewhere.When you use the Javascript-API, you must set the option
provideRouteAlternativesof the DirectionsRequest to true to get multiple routes.But there is no implemented option to display all returned routes at the same time, the Renderer by default will display the first route.
You may set the
panelfor the Renderer, the user will be able to select alternative routes there.To have all the routes visible at the same time you must parse the
directionsResponseand draw polylines for each route on your own.