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

Always get only one alternative Route

Open mreduar opened this issue 2 years ago • 1 comments

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. image

But when I do it with your package I always get only one route. image

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?

mreduar avatar Aug 24 '21 14:08 mreduar

you can use my API https://signalistapi.azurewebsites.net/api/directions?origin=10.0631549,-69.3103233&destination=10.0540698,-69.3421256

hostomani avatar Oct 24 '21 07:10 hostomani