@@ -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 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $territory = new Territory(); |
14 | 14 | |
15 | -$queryparameters = array ( |
|
15 | +$queryparameters = array( |
|
16 | 16 | "offset" => 0, |
17 | 17 | "limit" => 20 |
18 | 18 | ); |
@@ -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(); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | ); |
21 | 21 | |
22 | 22 | $TerritoryParameters = Territory::fromArray(array( |
23 | - "territory_name" => "Test Rectangular Territory ".strval(rand(10000,99999)), |
|
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 |
@@ -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); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -15,14 +15,14 @@ discard block |
||
15 | 15 | |
16 | 16 | // Add Avoidance Zone and get territory_id |
17 | 17 | $territory = new Territory(); |
18 | -$territory->type = TerritoryTypes::CIRCLE; |
|
19 | -$territory->data = array ( |
|
18 | +$territory->type = TerritoryTypes::CIRCLE; |
|
19 | +$territory->data = array( |
|
20 | 20 | "37.569752822786455,-77.47833251953125", |
21 | 21 | "5000" |
22 | 22 | ); |
23 | 23 | |
24 | -$TerritoryParameters=Territory::fromArray(array( |
|
25 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
24 | +$TerritoryParameters = Territory::fromArray(array( |
|
25 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
26 | 26 | "territory_color" => "ff7700", |
27 | 27 | "territory" => $territory |
28 | 28 | )); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | echo "------------------------------------------------------------------------<br><br>"; |
37 | 37 | |
38 | 38 | // Update territory |
39 | -$territoryParameters = array ( |
|
39 | +$territoryParameters = array( |
|
40 | 40 | "type" => TerritoryTypes::RECT, |
41 | 41 | "data" => array( |
42 | 42 | "29.6600127358956,-95.6593322753906", |
@@ -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(); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -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,8 +26,8 @@ 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 | )); |
@@ -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 | $territory = new Territory(); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | echo "------------------------------------------------------------------------<br><br>"; |
41 | 41 | |
42 | 42 | $params = array( |
43 | - "territory_id" => $territory_id |
|
43 | + "territory_id" => $territory_id |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | $result1 = $territory->getTerritory($params); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -15,14 +15,14 @@ discard block |
||
15 | 15 | |
16 | 16 | // Add Territory and get territory_id |
17 | 17 | $territory = new Territory(); |
18 | -$territory->type = TerritoryTypes::CIRCLE; |
|
19 | -$territory->data = array ( |
|
18 | +$territory->type = TerritoryTypes::CIRCLE; |
|
19 | +$territory->data = array( |
|
20 | 20 | "37.569752822786455,-77.47833251953125", |
21 | 21 | "5000" |
22 | 22 | ); |
23 | 23 | |
24 | 24 | $TerritoryParameters = Territory::fromArray(array( |
25 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
25 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
26 | 26 | "territory_color" => "ff7700", |
27 | 27 | "territory" => $territory |
28 | 28 | )); |
@@ -13,14 +13,14 @@ |
||
13 | 13 | $territory = new Territory(); |
14 | 14 | $territory->type = TerritoryTypes::CIRCLE; |
15 | 15 | $territory->data = array ( |
16 | - "37.569752822786455,-77.47833251953125", |
|
17 | - "5000" |
|
16 | + "37.569752822786455,-77.47833251953125", |
|
17 | + "5000" |
|
18 | 18 | ); |
19 | 19 | |
20 | 20 | $TerritoryParameters= Territory::fromArray(array( |
21 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
22 | - "territory_color" => "ff7700", |
|
23 | - "territory" => $territory |
|
21 | + "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
22 | + "territory_color" => "ff7700", |
|
23 | + "territory" => $territory |
|
24 | 24 | )); |
25 | 25 | |
26 | 26 | $territory = new Territory(); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -11,14 +11,14 @@ discard block |
||
11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
12 | 12 | |
13 | 13 | $territory = new Territory(); |
14 | -$territory->type = TerritoryTypes::CIRCLE; |
|
15 | -$territory->data = array ( |
|
14 | +$territory->type = TerritoryTypes::CIRCLE; |
|
15 | +$territory->data = array( |
|
16 | 16 | "37.569752822786455,-77.47833251953125", |
17 | 17 | "5000" |
18 | 18 | ); |
19 | 19 | |
20 | -$TerritoryParameters= Territory::fromArray(array( |
|
21 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
20 | +$TerritoryParameters = Territory::fromArray(array( |
|
21 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
22 | 22 | "territory_color" => "ff7700", |
23 | 23 | "territory" => $territory |
24 | 24 | )); |
@@ -26,23 +26,23 @@ discard block |
||
26 | 26 | |
27 | 27 | $addresses = array(); |
28 | 28 | foreach($json as $address) { |
29 | - $addresses[] = Address::fromArray($address); |
|
29 | + $addresses[] = Address::fromArray($address); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | $parameters = RouteParameters::fromArray(array( |
33 | - "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
|
34 | - "route_name" => "Multiple Depot, Multiple Driver, Time Window", |
|
35 | - "route_date" => time() + 24*60*60, |
|
36 | - "route_time" => 60 * 60 * 7, |
|
37 | - "rt" => TRUE, |
|
38 | - "distance_unit" => DistanceUnit::MILES, |
|
39 | - "device_type" => DeviceType::WEB, |
|
40 | - "optimize" => OptimizationType::TIME, |
|
41 | - "metric" => Metric::GEODESIC, |
|
42 | - "route_max_duration" => 86400 * 3, |
|
43 | - "travel_mode" => TravelMode::DRIVING, |
|
44 | - "vehicle_capacity" => 99, |
|
45 | - "vehicle_max_distance_mi" => 99999 |
|
33 | + "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
|
34 | + "route_name" => "Multiple Depot, Multiple Driver, Time Window", |
|
35 | + "route_date" => time() + 24*60*60, |
|
36 | + "route_time" => 60 * 60 * 7, |
|
37 | + "rt" => TRUE, |
|
38 | + "distance_unit" => DistanceUnit::MILES, |
|
39 | + "device_type" => DeviceType::WEB, |
|
40 | + "optimize" => OptimizationType::TIME, |
|
41 | + "metric" => Metric::GEODESIC, |
|
42 | + "route_max_duration" => 86400 * 3, |
|
43 | + "travel_mode" => TravelMode::DRIVING, |
|
44 | + "vehicle_capacity" => 99, |
|
45 | + "vehicle_max_distance_mi" => 99999 |
|
46 | 46 | )); |
47 | 47 | |
48 | 48 | $optimizationParams = new OptimizationProblemParams; |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | $problem = OptimizationProblem::optimize($optimizationParams); |
53 | 53 | |
54 | 54 | foreach ((array)$problem as $key => $value) { |
55 | - if (is_string($value)) { |
|
56 | - echo $key." --> ".$value."<br>"; |
|
57 | - } else { |
|
58 | - echo "************ $key ************* <br>"; |
|
59 | - Route4Me::simplePrint((array)$value, true); |
|
60 | - echo "******************************* <br>"; |
|
61 | - } |
|
55 | + if (is_string($value)) { |
|
56 | + echo $key." --> ".$value."<br>"; |
|
57 | + } else { |
|
58 | + echo "************ $key ************* <br>"; |
|
59 | + Route4Me::simplePrint((array)$value, true); |
|
60 | + echo "******************************* <br>"; |
|
61 | + } |
|
62 | 62 | } |
63 | 63 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root=realpath(dirname(__FILE__).'/../'); |
|
4 | +$root = realpath(dirname(__FILE__).'/../'); |
|
5 | 5 | require $root.'/vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | $json = json_decode(file_get_contents('./addresses.json'), true); |
26 | 26 | |
27 | 27 | $addresses = array(); |
28 | -foreach($json as $address) { |
|
28 | +foreach ($json as $address) { |
|
29 | 29 | $addresses[] = Address::fromArray($address); |
30 | 30 | } |
31 | 31 | |
32 | 32 | $parameters = RouteParameters::fromArray(array( |
33 | 33 | "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
34 | 34 | "route_name" => "Multiple Depot, Multiple Driver, Time Window", |
35 | - "route_date" => time() + 24*60*60, |
|
35 | + "route_date" => time() + 24 * 60 * 60, |
|
36 | 36 | "route_time" => 60 * 60 * 7, |
37 | 37 | "rt" => TRUE, |
38 | 38 | "distance_unit" => DistanceUnit::MILES, |
@@ -8,18 +8,18 @@ |
||
8 | 8 | |
9 | 9 | class Track extends Common |
10 | 10 | { |
11 | - public static function set(TrackSetParams $param) |
|
12 | - { |
|
13 | - $query = array_merge($param->toArray(), array( |
|
14 | - 'api_key' => Route4Me::getApiKey() |
|
15 | - )); |
|
11 | + public static function set(TrackSetParams $param) |
|
12 | + { |
|
13 | + $query = array_merge($param->toArray(), array( |
|
14 | + 'api_key' => Route4Me::getApiKey() |
|
15 | + )); |
|
16 | 16 | |
17 | - $json = Route4Me::makeRequst(array( |
|
18 | - 'url' => Endpoint::TRACK_SET, |
|
19 | - 'method' => 'GET', |
|
20 | - 'query' => $query |
|
21 | - )); |
|
17 | + $json = Route4Me::makeRequst(array( |
|
18 | + 'url' => Endpoint::TRACK_SET, |
|
19 | + 'method' => 'GET', |
|
20 | + 'query' => $query |
|
21 | + )); |
|
22 | 22 | |
23 | - return $json; |
|
24 | - } |
|
23 | + return $json; |
|
24 | + } |
|
25 | 25 | } |
@@ -6,141 +6,141 @@ |
||
6 | 6 | |
7 | 7 | class Geocoding extends Common |
8 | 8 | { |
9 | - public $strExportFormat; |
|
10 | - public $format; |
|
11 | - public $addresses; |
|
12 | - public $pk; |
|
13 | - public $offset; |
|
14 | - public $limit; |
|
15 | - public $housenumber; |
|
16 | - public $zipcode; |
|
9 | + public $strExportFormat; |
|
10 | + public $format; |
|
11 | + public $addresses; |
|
12 | + public $pk; |
|
13 | + public $offset; |
|
14 | + public $limit; |
|
15 | + public $housenumber; |
|
16 | + public $zipcode; |
|
17 | 17 | |
18 | - public static function fromArray(array $params) |
|
19 | - { |
|
20 | - $geocoding = new Geocoding(); |
|
21 | - |
|
22 | - foreach($params as $key => $value) { |
|
23 | - if (property_exists($geocoding, $key)) { |
|
24 | - $geocoding->{$key} = $value; |
|
25 | - } |
|
26 | - } |
|
27 | - |
|
28 | - return $geocoding; |
|
29 | - } |
|
18 | + public static function fromArray(array $params) |
|
19 | + { |
|
20 | + $geocoding = new Geocoding(); |
|
21 | + |
|
22 | + foreach($params as $key => $value) { |
|
23 | + if (property_exists($geocoding, $key)) { |
|
24 | + $geocoding->{$key} = $value; |
|
25 | + } |
|
26 | + } |
|
27 | + |
|
28 | + return $geocoding; |
|
29 | + } |
|
30 | 30 | |
31 | - public static function forwardGeocoding($params) |
|
32 | - { |
|
33 | - $body = array( |
|
34 | - 'strExportFormat' => isset($params['strExportFormat']) ? $params['strExportFormat']: null, |
|
35 | - 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
|
36 | - ); |
|
31 | + public static function forwardGeocoding($params) |
|
32 | + { |
|
33 | + $body = array( |
|
34 | + 'strExportFormat' => isset($params['strExportFormat']) ? $params['strExportFormat']: null, |
|
35 | + 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
|
36 | + ); |
|
37 | 37 | |
38 | - $fgCoding = Route4Me::makeRequst(array( |
|
39 | - 'url' => Endpoint::GEOCODER, |
|
40 | - 'method' => 'POST', |
|
41 | - 'body' => $body, |
|
42 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
43 | - )); |
|
44 | - |
|
45 | - return $fgCoding; |
|
46 | - } |
|
38 | + $fgCoding = Route4Me::makeRequst(array( |
|
39 | + 'url' => Endpoint::GEOCODER, |
|
40 | + 'method' => 'POST', |
|
41 | + 'body' => $body, |
|
42 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
43 | + )); |
|
44 | + |
|
45 | + return $fgCoding; |
|
46 | + } |
|
47 | 47 | |
48 | - public static function reverseGeocoding($params) |
|
49 | - { |
|
50 | - $query = array( |
|
51 | - 'format' => isset($params['format']) ? $params['format']: null, |
|
52 | - 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
|
53 | - 'detailed' => isset($params['detailed']) ? $params['detailed'] : null, |
|
54 | - ); |
|
48 | + public static function reverseGeocoding($params) |
|
49 | + { |
|
50 | + $query = array( |
|
51 | + 'format' => isset($params['format']) ? $params['format']: null, |
|
52 | + 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
|
53 | + 'detailed' => isset($params['detailed']) ? $params['detailed'] : null, |
|
54 | + ); |
|
55 | 55 | |
56 | - $fgcoding = Route4Me::makeRequst(array( |
|
57 | - 'url' => Endpoint::GEOCODER, |
|
58 | - 'method' => 'POST', |
|
59 | - 'query' => $query |
|
60 | - )); |
|
61 | - |
|
62 | - return $fgcoding; |
|
63 | - } |
|
56 | + $fgcoding = Route4Me::makeRequst(array( |
|
57 | + 'url' => Endpoint::GEOCODER, |
|
58 | + 'method' => 'POST', |
|
59 | + 'query' => $query |
|
60 | + )); |
|
61 | + |
|
62 | + return $fgcoding; |
|
63 | + } |
|
64 | 64 | |
65 | - public static function getStreetData($params) |
|
66 | - { |
|
67 | - $url_query = Endpoint::STREET_DATA; |
|
65 | + public static function getStreetData($params) |
|
66 | + { |
|
67 | + $url_query = Endpoint::STREET_DATA; |
|
68 | 68 | |
69 | - if (isset($params['pk'])) { |
|
70 | - $url_query.=$params['pk'].'/'; |
|
71 | - } |
|
69 | + if (isset($params['pk'])) { |
|
70 | + $url_query.=$params['pk'].'/'; |
|
71 | + } |
|
72 | 72 | |
73 | - if (isset($params['offset'])) { |
|
74 | - $url_query.=$params['offset'].'/'; |
|
75 | - } |
|
73 | + if (isset($params['offset'])) { |
|
74 | + $url_query.=$params['offset'].'/'; |
|
75 | + } |
|
76 | 76 | |
77 | - if (isset($params['limit'])) { |
|
78 | - $url_query.=$params['limit'].'/'; |
|
79 | - } |
|
77 | + if (isset($params['limit'])) { |
|
78 | + $url_query.=$params['limit'].'/'; |
|
79 | + } |
|
80 | 80 | |
81 | - $query = array(); |
|
81 | + $query = array(); |
|
82 | 82 | |
83 | - $response = Route4Me::makeUrlRequst($url_query, array( |
|
84 | - 'method' => 'GET', |
|
85 | - 'query' => $query |
|
86 | - )); |
|
83 | + $response = Route4Me::makeUrlRequst($url_query, array( |
|
84 | + 'method' => 'GET', |
|
85 | + 'query' => $query |
|
86 | + )); |
|
87 | 87 | |
88 | - return $response; |
|
89 | - } |
|
88 | + return $response; |
|
89 | + } |
|
90 | 90 | |
91 | - public static function getZipCode($params) |
|
92 | - { |
|
93 | - $url_query = Endpoint::STREET_DATA_ZIPCODE; |
|
91 | + public static function getZipCode($params) |
|
92 | + { |
|
93 | + $url_query = Endpoint::STREET_DATA_ZIPCODE; |
|
94 | 94 | |
95 | - if (isset($params['zipcode'])) { |
|
96 | - $url_query.=$params['zipcode'].'/'; |
|
97 | - } |
|
95 | + if (isset($params['zipcode'])) { |
|
96 | + $url_query.=$params['zipcode'].'/'; |
|
97 | + } |
|
98 | 98 | |
99 | - if (isset($params['offset'])) { |
|
100 | - $url_query.=$params['offset'].'/'; |
|
101 | - } |
|
99 | + if (isset($params['offset'])) { |
|
100 | + $url_query.=$params['offset'].'/'; |
|
101 | + } |
|
102 | 102 | |
103 | - if (isset($params['limit'])) { |
|
104 | - $url_query.=$params['limit'].'/'; |
|
105 | - } |
|
103 | + if (isset($params['limit'])) { |
|
104 | + $url_query.=$params['limit'].'/'; |
|
105 | + } |
|
106 | 106 | |
107 | - $query = array(); |
|
107 | + $query = array(); |
|
108 | 108 | |
109 | - $response = Route4Me::makeUrlRequst($url_query, array( |
|
110 | - 'method' => 'GET', |
|
111 | - 'query' => $query |
|
112 | - )); |
|
109 | + $response = Route4Me::makeUrlRequst($url_query, array( |
|
110 | + 'method' => 'GET', |
|
111 | + 'query' => $query |
|
112 | + )); |
|
113 | 113 | |
114 | - return $response; |
|
115 | - } |
|
114 | + return $response; |
|
115 | + } |
|
116 | 116 | |
117 | - public static function getService($params) |
|
118 | - { |
|
119 | - $url_query = Endpoint::STREET_DATA_SERVICE; |
|
117 | + public static function getService($params) |
|
118 | + { |
|
119 | + $url_query = Endpoint::STREET_DATA_SERVICE; |
|
120 | 120 | |
121 | - if (isset($params['zipcode'])) { |
|
122 | - $url_query.=$params['zipcode'].'/'; |
|
123 | - } |
|
121 | + if (isset($params['zipcode'])) { |
|
122 | + $url_query.=$params['zipcode'].'/'; |
|
123 | + } |
|
124 | 124 | |
125 | - if (isset($params['housenumber'])) { |
|
126 | - $url_query.=$params['housenumber'].'/'; |
|
127 | - } |
|
125 | + if (isset($params['housenumber'])) { |
|
126 | + $url_query.=$params['housenumber'].'/'; |
|
127 | + } |
|
128 | 128 | |
129 | - if (isset($params['offset'])) { |
|
130 | - $url_query.=$params['offset'].'/'; |
|
131 | - } |
|
129 | + if (isset($params['offset'])) { |
|
130 | + $url_query.=$params['offset'].'/'; |
|
131 | + } |
|
132 | 132 | |
133 | - if (isset($params['limit'])) { |
|
134 | - $url_query.=$params['limit'].'/'; |
|
135 | - } |
|
133 | + if (isset($params['limit'])) { |
|
134 | + $url_query.=$params['limit'].'/'; |
|
135 | + } |
|
136 | 136 | |
137 | - $query = array(); |
|
137 | + $query = array(); |
|
138 | 138 | |
139 | - $response = Route4Me::makeUrlRequst($url_query, array( |
|
140 | - 'method' => 'GET', |
|
141 | - 'query' => $query |
|
142 | - )); |
|
139 | + $response = Route4Me::makeUrlRequst($url_query, array( |
|
140 | + 'method' => 'GET', |
|
141 | + 'query' => $query |
|
142 | + )); |
|
143 | 143 | |
144 | - return $response; |
|
145 | - } |
|
144 | + return $response; |
|
145 | + } |
|
146 | 146 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | $geocoding = new Geocoding(); |
21 | 21 | |
22 | - foreach($params as $key => $value) { |
|
22 | + foreach ($params as $key => $value) { |
|
23 | 23 | if (property_exists($geocoding, $key)) { |
24 | 24 | $geocoding->{$key} = $value; |
25 | 25 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public static function forwardGeocoding($params) |
32 | 32 | { |
33 | 33 | $body = array( |
34 | - 'strExportFormat' => isset($params['strExportFormat']) ? $params['strExportFormat']: null, |
|
34 | + 'strExportFormat' => isset($params['strExportFormat']) ? $params['strExportFormat'] : null, |
|
35 | 35 | 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
36 | 36 | ); |
37 | 37 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | public static function reverseGeocoding($params) |
49 | 49 | { |
50 | 50 | $query = array( |
51 | - 'format' => isset($params['format']) ? $params['format']: null, |
|
51 | + 'format' => isset($params['format']) ? $params['format'] : null, |
|
52 | 52 | 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
53 | 53 | 'detailed' => isset($params['detailed']) ? $params['detailed'] : null, |
54 | 54 | ); |
@@ -67,15 +67,15 @@ discard block |
||
67 | 67 | $url_query = Endpoint::STREET_DATA; |
68 | 68 | |
69 | 69 | if (isset($params['pk'])) { |
70 | - $url_query.=$params['pk'].'/'; |
|
70 | + $url_query .= $params['pk'].'/'; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | if (isset($params['offset'])) { |
74 | - $url_query.=$params['offset'].'/'; |
|
74 | + $url_query .= $params['offset'].'/'; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | if (isset($params['limit'])) { |
78 | - $url_query.=$params['limit'].'/'; |
|
78 | + $url_query .= $params['limit'].'/'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | $query = array(); |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | $url_query = Endpoint::STREET_DATA_ZIPCODE; |
94 | 94 | |
95 | 95 | if (isset($params['zipcode'])) { |
96 | - $url_query.=$params['zipcode'].'/'; |
|
96 | + $url_query .= $params['zipcode'].'/'; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | if (isset($params['offset'])) { |
100 | - $url_query.=$params['offset'].'/'; |
|
100 | + $url_query .= $params['offset'].'/'; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if (isset($params['limit'])) { |
104 | - $url_query.=$params['limit'].'/'; |
|
104 | + $url_query .= $params['limit'].'/'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | $query = array(); |
@@ -119,19 +119,19 @@ discard block |
||
119 | 119 | $url_query = Endpoint::STREET_DATA_SERVICE; |
120 | 120 | |
121 | 121 | if (isset($params['zipcode'])) { |
122 | - $url_query.=$params['zipcode'].'/'; |
|
122 | + $url_query .= $params['zipcode'].'/'; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | if (isset($params['housenumber'])) { |
126 | - $url_query.=$params['housenumber'].'/'; |
|
126 | + $url_query .= $params['housenumber'].'/'; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | if (isset($params['offset'])) { |
130 | - $url_query.=$params['offset'].'/'; |
|
130 | + $url_query .= $params['offset'].'/'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | if (isset($params['limit'])) { |
134 | - $url_query.=$params['limit'].'/'; |
|
134 | + $url_query .= $params['limit'].'/'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | $query = array(); |