google-maps
google-maps copied to clipboard
Always get only one alternative Route
Hi, I am trying to get all the alternative routes between two points with coordinates, but I always get only one route even though I am sending alternatives=true
in the request parameters.
Let me give you an example.
In this link You will get three routes in total, the main route and two alternative routes.
But when I do it with your package I always get only one route.
This is the code I am using to get the alternate routes with your package.
$origins = ['10.0631549', '-69.3103233'];
$destinations = ['10.0540698', '-69.3421256'];
$response = \GoogleMaps::load('directions')
->setParam([
'origin' => implode(',', $origins),
'destination' => implode(',', $destinations),
'alternatives' => true,
'language' => 'es'
])->get();
What do I have to do to get the alternative routes with your package?
you can use my API https://signalistapi.azurewebsites.net/api/directions?origin=10.0631549,-69.3103233&destination=10.0540698,-69.3421256