@@ -23,22 +23,22 @@ |
||
| 23 | 23 | |
| 24 | 24 | $addresses = array(); |
| 25 | 25 | foreach($json as $address) { |
| 26 | - $addresses[] = Address::fromArray($address); |
|
| 26 | + $addresses[] = Address::fromArray($address); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | $parameters = RouteParameters::fromArray(array( |
| 30 | - "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
|
| 31 | - "route_name" => "Multiple Depot, Multiple Driver with 24 Stops, Time Window", |
|
| 32 | - "route_date" => time() + 24*60*60, |
|
| 33 | - "route_time" => 60 * 60 * 7, |
|
| 34 | - "distance_unit" => DistanceUnit::MILES, |
|
| 35 | - "device_type" => DeviceType::WEB, |
|
| 36 | - "optimize" => OptimizationType::DISTANCE, |
|
| 37 | - "metric" => Metric::GEODESIC, |
|
| 38 | - "route_max_duration" => 86400, |
|
| 39 | - "travel_mode" => TravelMode::DRIVING, |
|
| 40 | - "vehicle_capacity" => 1, |
|
| 41 | - "vehicle_max_distance_mi" => 10000 |
|
| 30 | + "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
|
| 31 | + "route_name" => "Multiple Depot, Multiple Driver with 24 Stops, Time Window", |
|
| 32 | + "route_date" => time() + 24*60*60, |
|
| 33 | + "route_time" => 60 * 60 * 7, |
|
| 34 | + "distance_unit" => DistanceUnit::MILES, |
|
| 35 | + "device_type" => DeviceType::WEB, |
|
| 36 | + "optimize" => OptimizationType::DISTANCE, |
|
| 37 | + "metric" => Metric::GEODESIC, |
|
| 38 | + "route_max_duration" => 86400, |
|
| 39 | + "travel_mode" => TravelMode::DRIVING, |
|
| 40 | + "vehicle_capacity" => 1, |
|
| 41 | + "vehicle_max_distance_mi" => 10000 |
|
| 42 | 42 | )); |
| 43 | 43 | |
| 44 | 44 | $optimizationParams = new OptimizationProblemParams; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | -require __DIR__.'/../vendor/autoload.php';; |
|
| 3 | +require __DIR__.'/../vendor/autoload.php'; ; |
|
| 4 | 4 | //See video tutorial here: http://support.route4me.com/route-planning-help.php?id=manual0:tutorial2:chapter2:subchapter2 |
| 5 | 5 | |
| 6 | 6 | use Route4Me\Route4Me; |
@@ -22,14 +22,14 @@ discard block |
||
| 22 | 22 | $json = json_decode(file_get_contents('./addresses.json'), true); |
| 23 | 23 | |
| 24 | 24 | $addresses = array(); |
| 25 | -foreach($json as $address) { |
|
| 25 | +foreach ($json as $address) { |
|
| 26 | 26 | $addresses[] = Address::fromArray($address); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | $parameters = RouteParameters::fromArray(array( |
| 30 | 30 | "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
| 31 | 31 | "route_name" => "Multiple Depot, Multiple Driver with 24 Stops, Time Window", |
| 32 | - "route_date" => time() + 24*60*60, |
|
| 32 | + "route_date" => time() + 24 * 60 * 60, |
|
| 33 | 33 | "route_time" => 60 * 60 * 7, |
| 34 | 34 | "distance_unit" => DistanceUnit::MILES, |
| 35 | 35 | "device_type" => DeviceType::WEB, |
@@ -7,14 +7,12 @@ |
||
| 7 | 7 | use Route4Me\Enum\OptimizationType; |
| 8 | 8 | use Route4Me\OptimizationProblem; |
| 9 | 9 | use Route4Me\OptimizationProblemParams; |
| 10 | -use Route4Me\Enum\AlgorithmType; |
|
| 11 | 10 | use Route4Me\Enum\DistanceUnit; |
| 12 | 11 | use Route4Me\Enum\DeviceType; |
| 13 | 12 | use Route4Me\Enum\TravelMode; |
| 14 | 13 | use Route4Me\Enum\Metric; |
| 15 | 14 | use Route4Me\RouteParameters; |
| 16 | 15 | use Route4Me\Address; |
| 17 | -use Route4Me\Route; |
|
| 18 | 16 | |
| 19 | 17 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 20 | 18 | |
@@ -47,8 +47,7 @@ |
||
| 47 | 47 | if (is_string($value)) |
| 48 | 48 | { |
| 49 | 49 | echo $key." --> ".$value."<br>"; |
| 50 | - } |
|
| 51 | - else |
|
| 50 | + } else |
|
| 52 | 51 | { |
| 53 | 52 | echo "************ $key ************* <br>"; |
| 54 | 53 | Route4Me::simplePrint((array)$value); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -13,23 +13,23 @@ discard block |
||
| 13 | 13 | // Add Territory and get territory_id |
| 14 | 14 | //--------------------------------------------------------- |
| 15 | 15 | $territory = new Territory(); |
| 16 | - $territory->type = TerritoryTypes::CIRCLE; |
|
| 17 | - $territory->data = array ( |
|
| 16 | + $territory->type = TerritoryTypes::CIRCLE; |
|
| 17 | + $territory->data = array( |
|
| 18 | 18 | "37.569752822786455,-77.47833251953125", |
| 19 | 19 | "5000" |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | - $TerritoryParameters=Territory::fromArray(array( |
|
| 23 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
| 22 | + $TerritoryParameters = Territory::fromArray(array( |
|
| 23 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
| 24 | 24 | "territory_color" => "ff7700", |
| 25 | 25 | "territory" => $territory |
| 26 | 26 | )); |
| 27 | 27 | |
| 28 | - $territory=new Territory(); |
|
| 28 | + $territory = new Territory(); |
|
| 29 | 29 | |
| 30 | 30 | $result = (array)$territory->addTerritory($TerritoryParameters); |
| 31 | 31 | |
| 32 | - $territory_id=""; |
|
| 32 | + $territory_id = ""; |
|
| 33 | 33 | if (isset($result)) { |
| 34 | 34 | $territory_id = $result["territory_id"]; |
| 35 | 35 | } else { |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
| 5 | 5 | |
| 6 | - require $vdir.'/../vendor/autoload.php'; |
|
| 6 | + require $vdir.'/../vendor/autoload.php'; |
|
| 7 | 7 | |
| 8 | 8 | use Route4Me\Route4Me; |
| 9 | 9 | use Route4Me\Route; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | $territory = new Territory(); |
| 15 | 15 | |
| 16 | - $queryparameters=array ( |
|
| 16 | + $queryparameters = array( |
|
| 17 | 17 | "offset" => 0, |
| 18 | 18 | "limit" => 20 |
| 19 | 19 | ); |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
| 8 | 8 | use Route4Me\Route4Me; |
| 9 | - use Route4Me\Enum\TerritoryTypes; |
|
| 10 | 9 | // Set the api key in the Route4Me class |
| 11 | 10 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 12 | 11 | |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
| 5 | 5 | |
| 6 | - require $vdir.'/../vendor/autoload.php'; |
|
| 6 | + require $vdir.'/../vendor/autoload.php'; |
|
| 7 | 7 | |
| 8 | 8 | use Route4Me\Route4Me; |
| 9 | 9 | use Route4Me\Route; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -13,19 +13,19 @@ discard block |
||
| 13 | 13 | // Example refers to the process of creating Territory with rectangular shape |
| 14 | 14 | |
| 15 | 15 | $territory = new Territory(); |
| 16 | - $territory->type = TerritoryTypes::RECT; |
|
| 17 | - $territory->data = array ( |
|
| 16 | + $territory->type = TerritoryTypes::RECT; |
|
| 17 | + $territory->data = array( |
|
| 18 | 18 | "43.51668853502909,-109.3798828125", |
| 19 | 19 | "46.98025235521883,-101.865234375" |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | - $TerritoryParameters=Territory::fromArray(array( |
|
| 23 | - "territory_name" => "Test Rectangular Territory ".strval(rand(10000,99999)), |
|
| 22 | + $TerritoryParameters = Territory::fromArray(array( |
|
| 23 | + "territory_name" => "Test Rectangular Territory ".strval(rand(10000, 99999)), |
|
| 24 | 24 | "territory_color" => "ff7700", |
| 25 | 25 | "territory" => $territory |
| 26 | 26 | )); |
| 27 | 27 | |
| 28 | - $territory=new Territory(); |
|
| 28 | + $territory = new Territory(); |
|
| 29 | 29 | |
| 30 | 30 | $result = $territory->addTerritory($TerritoryParameters); |
| 31 | 31 | |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
| 5 | 5 | |
| 6 | - require $vdir.'/../vendor/autoload.php'; |
|
| 6 | + require $vdir.'/../vendor/autoload.php'; |
|
| 7 | 7 | |
| 8 | 8 | use Route4Me\Route4Me; |
| 9 | 9 | use Route4Me\Route; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -14,23 +14,23 @@ discard block |
||
| 14 | 14 | // Add Avoidance Zone and get territory_id |
| 15 | 15 | //--------------------------------------------------------- |
| 16 | 16 | $territory = new Territory(); |
| 17 | - $territory->type = TerritoryTypes::CIRCLE; |
|
| 18 | - $territory->data = array ( |
|
| 17 | + $territory->type = TerritoryTypes::CIRCLE; |
|
| 18 | + $territory->data = array( |
|
| 19 | 19 | "37.569752822786455,-77.47833251953125", |
| 20 | 20 | "5000" |
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | - $TerritoryParameters=Territory::fromArray(array( |
|
| 24 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
| 23 | + $TerritoryParameters = Territory::fromArray(array( |
|
| 24 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
| 25 | 25 | "territory_color" => "ff7700", |
| 26 | 26 | "territory" => $territory |
| 27 | 27 | )); |
| 28 | 28 | |
| 29 | - $territory=new Territory(); |
|
| 29 | + $territory = new Territory(); |
|
| 30 | 30 | |
| 31 | 31 | $result = (array)$territory->addTerritory($TerritoryParameters); |
| 32 | 32 | |
| 33 | - $territory_id=""; |
|
| 33 | + $territory_id = ""; |
|
| 34 | 34 | if (isset($result)) { |
| 35 | 35 | $territory_id = $result["territory_id"]; |
| 36 | 36 | } else { |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | //----------------------------------------------------------- |
| 44 | 44 | |
| 45 | 45 | $territory = new Territory(); |
| 46 | - $territory->type = TerritoryTypes::RECT; |
|
| 47 | - $territory->data = array ( |
|
| 46 | + $territory->type = TerritoryTypes::RECT; |
|
| 47 | + $territory->data = array( |
|
| 48 | 48 | "37.869752822786455,-77.49833251953125", |
| 49 | 49 | "5000" |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | - $TerritoryParameters=Territory::fromArray(array( |
|
| 52 | + $TerritoryParameters = Territory::fromArray(array( |
|
| 53 | 53 | "territory_id" => $territory_id, |
| 54 | 54 | "territory_name" => "Test Territory Updated", |
| 55 | 55 | "territory_color" => "ff5500", |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
| 5 | 5 | |
| 6 | - require $vdir.'/../vendor/autoload.php'; |
|
| 6 | + require $vdir.'/../vendor/autoload.php'; |
|
| 7 | 7 | |
| 8 | 8 | use Route4Me\Route4Me; |
| 9 | 9 | use Route4Me\Route; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | // Example refers to the process of creating Territory with polygonian shape |
| 14 | 14 | |
| 15 | 15 | $territory = new Territory(); |
| 16 | - $territory->type = TerritoryTypes::POLY; |
|
| 17 | - $territory->data = array ( |
|
| 16 | + $territory->type = TerritoryTypes::POLY; |
|
| 17 | + $territory->data = array( |
|
| 18 | 18 | "37.769752822786455,-77.67833251953125", |
| 19 | 19 | "37.75886716305343,-77.68974800109863", |
| 20 | 20 | "37.74763966054455,-77.6917221069336", |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | "37.76641925847049,-77.66846199035645" |
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | - $TerritoryParameters=Territory::fromArray(array( |
|
| 30 | - "territory_name" => "Test Polygonian Territory ".strval(rand(10000,99999)), |
|
| 29 | + $TerritoryParameters = Territory::fromArray(array( |
|
| 30 | + "territory_name" => "Test Polygonian Territory ".strval(rand(10000, 99999)), |
|
| 31 | 31 | "territory_color" => "ff7700", |
| 32 | 32 | "territory" => $territory |
| 33 | 33 | )); |
| 34 | 34 | |
| 35 | - $territory=new Territory(); |
|
| 35 | + $territory = new Territory(); |
|
| 36 | 36 | |
| 37 | 37 | $result = $territory->addTerritory($TerritoryParameters); |
| 38 | 38 | |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
| 5 | 5 | |
| 6 | - require $vdir.'/../vendor/autoload.php'; |
|
| 6 | + require $vdir.'/../vendor/autoload.php'; |
|
| 7 | 7 | |
| 8 | 8 | use Route4Me\Route4Me; |
| 9 | 9 | use Route4Me\Route; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -12,19 +12,19 @@ discard block |
||
| 12 | 12 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 13 | 13 | |
| 14 | 14 | $territory = new Territory(); |
| 15 | - $territory->type = TerritoryTypes::CIRCLE; |
|
| 16 | - $territory->data = array ( |
|
| 15 | + $territory->type = TerritoryTypes::CIRCLE; |
|
| 16 | + $territory->data = array( |
|
| 17 | 17 | "37.569752822786455,-77.47833251953125", |
| 18 | 18 | "5000" |
| 19 | 19 | ); |
| 20 | 20 | |
| 21 | - $TerritoryParameters= Territory::fromArray(array( |
|
| 22 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
| 21 | + $TerritoryParameters = Territory::fromArray(array( |
|
| 22 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
| 23 | 23 | "territory_color" => "ff7700", |
| 24 | 24 | "territory" => $territory |
| 25 | 25 | )); |
| 26 | 26 | |
| 27 | - $territory=new Territory(); |
|
| 27 | + $territory = new Territory(); |
|
| 28 | 28 | |
| 29 | 29 | $result = $territory->addTerritory($TerritoryParameters); |
| 30 | 30 | |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
| 5 | 5 | |
| 6 | - require $vdir.'/../vendor/autoload.php'; |
|
| 6 | + require $vdir.'/../vendor/autoload.php'; |
|
| 7 | 7 | |
| 8 | 8 | use Route4Me\Route4Me; |
| 9 | 9 | use Route4Me\Route; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | // Get random route from test routes |
| 16 | 16 | //-------------------------------------------------------- |
| 17 | - $route=new Route(); |
|
| 17 | + $route = new Route(); |
|
| 18 | 18 | |
| 19 | - $route_id=$route->getRandomRouteId(0, 10); |
|
| 19 | + $route_id = $route->getRandomRouteId(0, 10); |
|
| 20 | 20 | |
| 21 | 21 | if (is_null($route_id)) { |
| 22 | 22 | echo "can't retrieve random route_id!.. Try again."; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | // Get random address's id from selected route above |
| 28 | 28 | //-------------------------------------------------------- |
| 29 | - $addressRand=(array)$route->GetRandomAddressFromRoute($route_id); |
|
| 29 | + $addressRand = (array)$route->GetRandomAddressFromRoute($route_id); |
|
| 30 | 30 | |
| 31 | 31 | if (isset($addressRand['is_depot'])) |
| 32 | 32 | { |
@@ -45,18 +45,18 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | //-------------------------------------------------------- |
| 47 | 47 | |
| 48 | - $addressParameters=(array)Address::fromArray(array( |
|
| 48 | + $addressParameters = (array)Address::fromArray(array( |
|
| 49 | 49 | "route_id" => $route_id, |
| 50 | 50 | "route_destination_id" => $address_id, |
| 51 | 51 | )); |
| 52 | 52 | |
| 53 | - $body= array( |
|
| 53 | + $body = array( |
|
| 54 | 54 | "is_departed" => TRUE, |
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | - $address=new Address(); |
|
| 57 | + $address = new Address(); |
|
| 58 | 58 | |
| 59 | - $result=$address->markAddress($addressParameters, $body); |
|
| 59 | + $result = $address->markAddress($addressParameters, $body); |
|
| 60 | 60 | |
| 61 | 61 | Route4Me::simplePrint($result); |
| 62 | 62 | ?> |
| 63 | 63 | \ No newline at end of file |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
| 5 | 5 | |
| 6 | - require $vdir.'/../vendor/autoload.php'; |
|
| 6 | + require $vdir.'/../vendor/autoload.php'; |
|
| 7 | 7 | |
| 8 | 8 | use Route4Me\Route4Me; |
| 9 | 9 | use Route4Me\Route; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
| 5 | 5 | |
| 6 | 6 | require $vdir.'/../vendor/autoload.php'; |
| 7 | 7 | |
@@ -13,9 +13,9 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // Get random route from test routes |
| 15 | 15 | //-------------------------------------------------------- |
| 16 | - $route=new Route(); |
|
| 16 | + $route = new Route(); |
|
| 17 | 17 | |
| 18 | - $route_id=$route->getRandomRouteId(0, 10); |
|
| 18 | + $route_id = $route->getRandomRouteId(0, 10); |
|
| 19 | 19 | |
| 20 | 20 | if (is_null($route_id)) { |
| 21 | 21 | echo "can't retrieve random route_id!.. Try again."; |
@@ -23,16 +23,16 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | //-------------------------------------------------------- |
| 25 | 25 | |
| 26 | - $addresses=array(); |
|
| 26 | + $addresses = array(); |
|
| 27 | 27 | |
| 28 | - $address1=(array)Address::fromArray(array( |
|
| 28 | + $address1 = (array)Address::fromArray(array( |
|
| 29 | 29 | 'address' => '146 Bill Johnson Rd NE Milledgeville GA 31061', |
| 30 | 30 | 'lat' => 33.143526, |
| 31 | 31 | 'lng' => -83.240354, |
| 32 | 32 | 'time' => 0 |
| 33 | 33 | )); |
| 34 | 34 | |
| 35 | - $address2=(array)Address::fromArray(array( |
|
| 35 | + $address2 = (array)Address::fromArray(array( |
|
| 36 | 36 | 'address' => '222 Blake Cir Milledgeville GA 31061', |
| 37 | 37 | 'lat' => 33.177852, |
| 38 | 38 | 'lng' => -83.263535, |
@@ -40,17 +40,17 @@ discard block |
||
| 40 | 40 | )); |
| 41 | 41 | |
| 42 | 42 | |
| 43 | - $addresses[]=$address1; |
|
| 44 | - $addresses[]=$address2; |
|
| 43 | + $addresses[] = $address1; |
|
| 44 | + $addresses[] = $address2; |
|
| 45 | 45 | |
| 46 | - $routeParameters=(array)Route::fromArray(array( |
|
| 46 | + $routeParameters = (array)Route::fromArray(array( |
|
| 47 | 47 | "route_id" => $route_id, |
| 48 | 48 | "addresses" => $addresses, |
| 49 | 49 | )); |
| 50 | 50 | |
| 51 | - $route1=new Route(); |
|
| 51 | + $route1 = new Route(); |
|
| 52 | 52 | |
| 53 | - $result=$route1->addAddresses($routeParameters); |
|
| 53 | + $result = $route1->addAddresses($routeParameters); |
|
| 54 | 54 | |
| 55 | 55 | Route4Me::simplePrint((array)$result); |
| 56 | 56 | ?> |
| 57 | 57 | \ No newline at end of file |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
| 5 | 5 | |
| 6 | - require $vdir.'/../vendor/autoload.php'; |
|
| 6 | + require $vdir.'/../vendor/autoload.php'; |
|
| 7 | 7 | |
| 8 | 8 | use Route4Me\Route4Me; |
| 9 | 9 | use Route4Me\Route; |