Skip to content Skip to sidebar Skip to footer

Suggested Routes Option In Google Maps Api?

I have a requirement to show multiple routes between the source and destination. Eg: If i am selecting a source and destination i am able to find one single route. But as in google

Solution 1:

from the documentation:

provideRouteAlternatives (optional) when set to true specifies that the Directions service may provide more than one route alternative in the response. Note that providing route alternatives may increase the response time from the server.

example

varrequest= {
    origin:start,
    destination:end,
    travelMode:google.maps.DirectionsTravelMode.DRIVING,
    provideRouteAlternatives:true
};

Post a Comment for "Suggested Routes Option In Google Maps Api?"