Directions Service to use optimize:true
Directions service to optimize the provided route by rearranging the waypoints in a more efficient order, using optimize:true
$d = \GoogleMaps::load('directions')
->setParam([
'origin' => 'Sao Paulo, SP',
'destination' => 'Sao Paulo, SP',
'mode' => 'driving',
'waypoints' => ['optimize:true','Rua Indico, Sao Bernardo do Campo,SP', 'Santos,SP', 'Rua Aurora, Sao Bernardo do Campo,SP', 'Santos,SP', 'Sorocaba,SP'],
'units' => 'metric',
'region' => 'BR',
'departure_time' => 'now',
])
->get();