Skip to content

Directions Service to use optimize:true

Compare
Choose a tag to compare
@alexpechkarev alexpechkarev released this 29 Aug 14:00
· 74 commits to master since this release

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();