@@ -19,9 +19,9 @@ |
||
19 | 19 | |
20 | 20 | // Share a route with an email |
21 | 21 | $params = [ |
22 | - 'route_id' => $route_id, |
|
23 | - 'response_format' => 'json', |
|
24 | - 'recipient_email' => '[email protected]', |
|
22 | + 'route_id' => $route_id, |
|
23 | + 'response_format' => 'json', |
|
24 | + 'recipient_email' => '[email protected]', |
|
25 | 25 | ]; |
26 | 26 | |
27 | 27 | $result = $route->shareRoute($params); |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | $vehicle = new Vehicles\Vehicle(); |
17 | 17 | |
18 | 18 | $vehicleParameters = [ |
19 | - 'with_pagination' => true, |
|
20 | - 'page' => 1, |
|
21 | - 'perPage' => 10, |
|
19 | + 'with_pagination' => true, |
|
20 | + 'page' => 1, |
|
21 | + 'perPage' => 10, |
|
22 | 22 | ]; |
23 | 23 | |
24 | 24 | $response = $vehicle->getVehicles($vehicleParameters); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $route->parameters = new \stdClass(); |
41 | 41 | |
42 | 42 | $route->parameters = [ |
43 | - 'vehicle_id' => $vehicleId, |
|
43 | + 'vehicle_id' => $vehicleId, |
|
44 | 44 | ]; |
45 | 45 | |
46 | 46 | $route->httpheaders = 'Content-type: application/json'; |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | Route4Me::setApiKey(Constants::API_KEY); |
10 | 10 | |
11 | 11 | $RouteParameters = [ |
12 | - 'start_date' => '2019-08-01', |
|
13 | - 'end_date' => '2019-08-05' |
|
12 | + 'start_date' => '2019-08-01', |
|
13 | + 'end_date' => '2019-08-05' |
|
14 | 14 | ]; |
15 | 15 | |
16 | 16 | $route = new Route(); |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | $routeResults = $route->getRoutes($RouteParameters); |
19 | 19 | |
20 | 20 | foreach ($routeResults as $routeResult) { |
21 | - $results = (array) $routeResult; |
|
21 | + $results = (array) $routeResult; |
|
22 | 22 | |
23 | - Route4Me::simplePrint($results); |
|
23 | + Route4Me::simplePrint($results); |
|
24 | 24 | |
25 | - echo '<br>'; |
|
25 | + echo '<br>'; |
|
26 | 26 | } |
27 | 27 | \ No newline at end of file |
@@ -18,14 +18,14 @@ |
||
18 | 18 | assert(!is_null($route_id), "Cannot retrieve a random route ID"); |
19 | 19 | |
20 | 20 | $params = [ |
21 | - 'route_id' => $route_id, |
|
21 | + 'route_id' => $route_id, |
|
22 | 22 | ]; |
23 | 23 | |
24 | 24 | $status = $route->resequenceAllAddresses($params); |
25 | 25 | |
26 | 26 | $params = [ |
27 | - 'route_id' => $route_id, |
|
28 | - 'original' => 1 |
|
27 | + 'route_id' => $route_id, |
|
28 | + 'original' => 1 |
|
29 | 29 | ]; |
30 | 30 | |
31 | 31 | $routeWithOriginRoute = $route->getRoutes($params); |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | Route4Me::setApiKey(Constants::API_KEY); |
10 | 10 | |
11 | 11 | $RouteParameters = [ |
12 | - 'limit' => 30, |
|
13 | - 'offset' => 0, |
|
12 | + 'limit' => 30, |
|
13 | + 'offset' => 0, |
|
14 | 14 | ]; |
15 | 15 | |
16 | 16 | $route = new Route(); |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | $routeResults = $route->getRoutes($RouteParameters); |
19 | 19 | |
20 | 20 | foreach ($routeResults as $routeResult) { |
21 | - $results = (array) $routeResult; |
|
21 | + $results = (array) $routeResult; |
|
22 | 22 | |
23 | - Route4Me::simplePrint($results); |
|
23 | + Route4Me::simplePrint($results); |
|
24 | 24 | |
25 | - echo '<br>'; |
|
25 | + echo '<br>'; |
|
26 | 26 | } |
@@ -21,26 +21,26 @@ |
||
21 | 21 | |
22 | 22 | // Get a route with the path points |
23 | 23 | $params = [ |
24 | - 'route_path_output' => 'Points', |
|
25 | - 'compress_path_points' => true, |
|
26 | - 'route_id' => $route_id, |
|
24 | + 'route_path_output' => 'Points', |
|
25 | + 'compress_path_points' => true, |
|
26 | + 'route_id' => $route_id, |
|
27 | 27 | ]; |
28 | 28 | |
29 | 29 | $routeResults = (array) $route->getRoutePoints($params); |
30 | 30 | |
31 | 31 | if (isset($routeResults['addresses'])) { |
32 | - foreach ($routeResults['addresses'] as $key => $address) { |
|
33 | - $arAddress = (array) $address; |
|
32 | + foreach ($routeResults['addresses'] as $key => $address) { |
|
33 | + $arAddress = (array) $address; |
|
34 | 34 | |
35 | - if (isset($araddress['route_destination_id'])) { |
|
36 | - echo 'route_destination_id='.$arAddress['route_destination_id'].'<br>'; |
|
37 | - } |
|
35 | + if (isset($araddress['route_destination_id'])) { |
|
36 | + echo 'route_destination_id='.$arAddress['route_destination_id'].'<br>'; |
|
37 | + } |
|
38 | 38 | |
39 | - if (isset($arAddress['path_to_next'])) { |
|
40 | - echo 'path_to_next:<br>'; |
|
41 | - Route4Me::simplePrint((array) $arAddress['path_to_next']); |
|
42 | - } |
|
39 | + if (isset($arAddress['path_to_next'])) { |
|
40 | + echo 'path_to_next:<br>'; |
|
41 | + Route4Me::simplePrint((array) $arAddress['path_to_next']); |
|
42 | + } |
|
43 | 43 | |
44 | - echo '<br>'; |
|
45 | - } |
|
44 | + echo '<br>'; |
|
45 | + } |
|
46 | 46 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $route->parameters = new \stdClass(); |
29 | 29 | |
30 | 30 | $route->parameters = [ |
31 | - 'recompute_directions' => 1, |
|
31 | + 'recompute_directions' => 1, |
|
32 | 32 | ]; |
33 | 33 | |
34 | 34 | $route->httpheaders = 'Content-type: application/json'; |
@@ -21,8 +21,8 @@ |
||
21 | 21 | |
22 | 22 | // Get a route with the directions |
23 | 23 | $params = [ |
24 | - 'directions' => 1, |
|
25 | - 'route_id' => $route_id, |
|
24 | + 'directions' => 1, |
|
25 | + 'route_id' => $route_id, |
|
26 | 26 | ]; |
27 | 27 | |
28 | 28 | $routeResults = (array) $route->getRoutePoints($params); |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | $count = 0; |
24 | 24 | |
25 | 25 | while ($route_id1 == $route_id2) { |
26 | - $route_id2 = $route->getRandomRouteId(0, 20); |
|
26 | + $route_id2 = $route->getRandomRouteId(0, 20); |
|
27 | 27 | |
28 | - ++$count; |
|
28 | + ++$count; |
|
29 | 29 | |
30 | - if ($count > 5) { |
|
31 | - break; |
|
32 | - } |
|
30 | + if ($count > 5) { |
|
31 | + break; |
|
32 | + } |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | echo "Route ID 1 -> $route_id1 <br> Route ID 2 -> $route_id2 <br>"; |
@@ -41,21 +41,21 @@ discard block |
||
41 | 41 | $depot = null; |
42 | 42 | |
43 | 43 | foreach ($addresses as $address) { |
44 | - if (isset($address->is_depot)) { |
|
45 | - if (true == $address->is_depot) { |
|
46 | - $depot = $address; |
|
47 | - break; |
|
48 | - } |
|
49 | - } |
|
44 | + if (isset($address->is_depot)) { |
|
45 | + if (true == $address->is_depot) { |
|
46 | + $depot = $address; |
|
47 | + break; |
|
48 | + } |
|
49 | + } |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // Merge the selected routes |
53 | 53 | $params = [ |
54 | - 'route_ids' => $route_id1.','.$route_id2, |
|
55 | - 'depot_address' => $depot->address, |
|
56 | - 'remove_origin' => false, |
|
57 | - 'depot_lat' => $depot->lat, |
|
58 | - 'depot_lng' => $depot->lng, |
|
54 | + 'route_ids' => $route_id1.','.$route_id2, |
|
55 | + 'depot_address' => $depot->address, |
|
56 | + 'remove_origin' => false, |
|
57 | + 'depot_lat' => $depot->lat, |
|
58 | + 'depot_lng' => $depot->lng, |
|
59 | 59 | ]; |
60 | 60 | |
61 | 61 | $result = $route->mergeRoutes($params); |