@@ -21,9 +21,9 @@ |
||
21 | 21 | |
22 | 22 | // Share a route with an email |
23 | 23 | $params = array( |
24 | - "route_id" => $route_id, |
|
25 | - "response_format" => "json", |
|
26 | - "recipient_email" => "[email protected]" |
|
24 | + "route_id" => $route_id, |
|
25 | + "response_format" => "json", |
|
26 | + "recipient_email" => "[email protected]" |
|
27 | 27 | ); |
28 | 28 | |
29 | 29 | $result = $route->shareRoute($params); |
@@ -30,10 +30,10 @@ |
||
30 | 30 | $route->parameters = new \stdClass(); |
31 | 31 | |
32 | 32 | $route->parameters = array( |
33 | - "member_id" => $randomRoute->member_id, |
|
34 | - "optimize" => "Distance", |
|
35 | - "route_max_duration" => "82400", |
|
36 | - "route_name" => "updated " . date('m-d-Y') |
|
33 | + "member_id" => $randomRoute->member_id, |
|
34 | + "optimize" => "Distance", |
|
35 | + "route_max_duration" => "82400", |
|
36 | + "route_name" => "updated " . date('m-d-Y') |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | $route->httpheaders = 'Content-type: application/json'; |
@@ -23,23 +23,23 @@ |
||
23 | 23 | |
24 | 24 | // Get a route with the path points |
25 | 25 | $params = array( |
26 | - "route_path_output" => "Points", |
|
27 | - "compress_path_points" => TRUE |
|
26 | + "route_path_output" => "Points", |
|
27 | + "compress_path_points" => TRUE |
|
28 | 28 | ); |
29 | 29 | |
30 | 30 | $routeResults = (array)$route->getRoutePoints($route_id,$params); |
31 | 31 | |
32 | 32 | if (isset($routeResults['addresses'])) { |
33 | - foreach ($routeResults['addresses'] as $key => $address) { |
|
34 | - $araddress = (array)$address; |
|
33 | + foreach ($routeResults['addresses'] as $key => $address) { |
|
34 | + $araddress = (array)$address; |
|
35 | 35 | |
36 | - if (isset($araddress['route_destination_id'])) echo "route_destination_id=".$araddress['route_destination_id']."<br>"; |
|
36 | + if (isset($araddress['route_destination_id'])) echo "route_destination_id=".$araddress['route_destination_id']."<br>"; |
|
37 | 37 | |
38 | - if (isset($araddress['path_to_next'])) { |
|
39 | - echo "path_to_next:<br>"; |
|
40 | - Route4Me::simplePrint((array)$araddress['path_to_next']); |
|
41 | - } |
|
38 | + if (isset($araddress['path_to_next'])) { |
|
39 | + echo "path_to_next:<br>"; |
|
40 | + Route4Me::simplePrint((array)$araddress['path_to_next']); |
|
41 | + } |
|
42 | 42 | |
43 | - echo "<br>"; |
|
44 | - } |
|
43 | + echo "<br>"; |
|
44 | + } |
|
45 | 45 | } |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | |
18 | 18 | // Select a terriotry with the addresses from the list |
19 | 19 | $params = array( |
20 | - "offset" => 0, |
|
21 | - "limit" => 50, |
|
22 | - "addresses" => 1 |
|
20 | + "offset" => 0, |
|
21 | + "limit" => 50, |
|
22 | + "addresses" => 1 |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | $results = $territory->getTerritories($params); |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | $territory1 = null; |
29 | 29 | |
30 | 30 | foreach ($results as $terr) { |
31 | - if (isset($terr['addresses'])) { |
|
32 | - if (sizeof($terr['addresses'])>0) { |
|
33 | - $territory1 = $terr; |
|
34 | - break; |
|
35 | - } |
|
36 | - } |
|
31 | + if (isset($terr['addresses'])) { |
|
32 | + if (sizeof($terr['addresses'])>0) { |
|
33 | + $territory1 = $terr; |
|
34 | + break; |
|
35 | + } |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | assert(isset($territory1['territory_id']), "Can't retrieve a random territory ID"); |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | |
44 | 44 | // Get a territory with the addresses |
45 | 45 | $params = array( |
46 | - "territory_id" => $territory_id, |
|
47 | - "addresses" => 1 |
|
46 | + "territory_id" => $territory_id, |
|
47 | + "addresses" => 1 |
|
48 | 48 | ); |
49 | 49 | |
50 | 50 | $result1 = $territory->getTerritory($params); |
@@ -20,14 +20,14 @@ |
||
20 | 20 | $territory = new Territory(); |
21 | 21 | $territory->type = TerritoryTypes::CIRCLE; |
22 | 22 | $territory->data = array ( |
23 | - "37.569752822786455,-77.47833251953125", |
|
24 | - "5000" |
|
23 | + "37.569752822786455,-77.47833251953125", |
|
24 | + "5000" |
|
25 | 25 | ); |
26 | 26 | |
27 | 27 | $TerritoryParameters = Territory::fromArray(array( |
28 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
29 | - "territory_color" => "ff7700", |
|
30 | - "territory" => $territory |
|
28 | + "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
29 | + "territory_color" => "ff7700", |
|
30 | + "territory" => $territory |
|
31 | 31 | )); |
32 | 32 | |
33 | 33 | $territory = new Territory(); |
@@ -13,13 +13,13 @@ |
||
13 | 13 | $territory = new Territory(); |
14 | 14 | |
15 | 15 | $queryparameters = array ( |
16 | - "offset" => 0, |
|
17 | - "limit" => 20 |
|
16 | + "offset" => 0, |
|
17 | + "limit" => 20 |
|
18 | 18 | ); |
19 | 19 | |
20 | 20 | $response = $territory->getTerritories($queryparameters); |
21 | 21 | |
22 | 22 | foreach ($response as $terr1) { |
23 | 23 | Route4Me::simplePrint($terr1, true); |
24 | - echo "<br>"; |
|
24 | + echo "<br>"; |
|
25 | 25 | } |
@@ -20,9 +20,9 @@ |
||
20 | 20 | ); |
21 | 21 | |
22 | 22 | $TerritoryParameters = Territory::fromArray(array( |
23 | - "territory_name" => "Test Rectangular Territory ".strval(rand(10000,99999)), |
|
24 | - "territory_color" => "ff7700", |
|
25 | - "territory" => $territory |
|
23 | + "territory_name" => "Test Rectangular Territory ".strval(rand(10000,99999)), |
|
24 | + "territory_color" => "ff7700", |
|
25 | + "territory" => $territory |
|
26 | 26 | )); |
27 | 27 | |
28 | 28 | $territory=new Territory(); |
@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | $territory = new Territory(); |
18 | 18 | $territory->type = TerritoryTypes::CIRCLE; |
19 | 19 | $territory->data = array ( |
20 | - "37.569752822786455,-77.47833251953125", |
|
21 | - "5000" |
|
20 | + "37.569752822786455,-77.47833251953125", |
|
21 | + "5000" |
|
22 | 22 | ); |
23 | 23 | |
24 | 24 | $TerritoryParameters=Territory::fromArray(array( |
25 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
26 | - "territory_color" => "ff7700", |
|
27 | - "territory" => $territory |
|
25 | + "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
26 | + "territory_color" => "ff7700", |
|
27 | + "territory" => $territory |
|
28 | 28 | )); |
29 | 29 | |
30 | 30 | $result = (array)$territory->addTerritory($TerritoryParameters); |
@@ -37,18 +37,18 @@ discard block |
||
37 | 37 | |
38 | 38 | // Update territory |
39 | 39 | $territoryParameters = array ( |
40 | - "type" => TerritoryTypes::RECT, |
|
41 | - "data" => array( |
|
42 | - "29.6600127358956,-95.6593322753906", |
|
43 | - "29.8966150753098,-95.3146362304688" |
|
44 | - ) |
|
40 | + "type" => TerritoryTypes::RECT, |
|
41 | + "data" => array( |
|
42 | + "29.6600127358956,-95.6593322753906", |
|
43 | + "29.8966150753098,-95.3146362304688" |
|
44 | + ) |
|
45 | 45 | ); |
46 | 46 | |
47 | 47 | $TerritoryParameters = Territory::fromArray(array( |
48 | - "territory_id" => $territory_id, |
|
49 | - "territory_name" => "Test Territory Updated as rectangle", |
|
50 | - "territory_color" => "ff5500", |
|
51 | - "territory" => $territoryParameters |
|
48 | + "territory_id" => $territory_id, |
|
49 | + "territory_name" => "Test Territory Updated as rectangle", |
|
50 | + "territory_color" => "ff5500", |
|
51 | + "territory" => $territoryParameters |
|
52 | 52 | )); |
53 | 53 | |
54 | 54 | $result1 = $territory->updateTerritory($TerritoryParameters); |
@@ -15,21 +15,21 @@ |
||
15 | 15 | $territory = new Territory(); |
16 | 16 | $territory->type = TerritoryTypes::POLY; |
17 | 17 | $territory->data = array ( |
18 | - "37.769752822786455,-77.67833251953125", |
|
19 | - "37.75886716305343,-77.68974800109863", |
|
20 | - "37.74763966054455,-77.6917221069336", |
|
21 | - "37.74655084306813,-77.68863220214844", |
|
22 | - "37.7502255383101,-77.68125076293945", |
|
23 | - "37.74797991274437,-77.67498512268066", |
|
24 | - "37.73327960206065,-77.6411678314209", |
|
25 | - "37.74430510679532,-77.63172645568848", |
|
26 | - "37.76641925847049,-77.66846199035645" |
|
18 | + "37.769752822786455,-77.67833251953125", |
|
19 | + "37.75886716305343,-77.68974800109863", |
|
20 | + "37.74763966054455,-77.6917221069336", |
|
21 | + "37.74655084306813,-77.68863220214844", |
|
22 | + "37.7502255383101,-77.68125076293945", |
|
23 | + "37.74797991274437,-77.67498512268066", |
|
24 | + "37.73327960206065,-77.6411678314209", |
|
25 | + "37.74430510679532,-77.63172645568848", |
|
26 | + "37.76641925847049,-77.66846199035645" |
|
27 | 27 | ); |
28 | 28 | |
29 | 29 | $TerritoryParameters=Territory::fromArray(array( |
30 | - "territory_name" => "Test Polygonian Territory ".strval(rand(10000,99999)), |
|
31 | - "territory_color" => "ff7700", |
|
32 | - "territory" => $territory |
|
30 | + "territory_name" => "Test Polygonian Territory ".strval(rand(10000,99999)), |
|
31 | + "territory_color" => "ff7700", |
|
32 | + "territory" => $territory |
|
33 | 33 | )); |
34 | 34 | |
35 | 35 | $territory = new Territory(); |