diff --git a/app/Http/Controllers/RoutingController.php b/app/Http/Controllers/RoutingController.php index af5238613871b8b61d3ba191c22706f8b7051189..a8594aeebc02fd757f081363c0ff0e73172a0f91 100644 --- a/app/Http/Controllers/RoutingController.php +++ b/app/Http/Controllers/RoutingController.php @@ -38,10 +38,8 @@ public function routingOverviewGeoJson($vehicle, $points) default: $port = 5000; } - $url = "http://maps.metager.de:$port/route/v1/$vehicle/$points?steps=true&geometries=geojson"; - if($port == 5002){ - $url = "http://94.130.163.243:$port/route/v1/$vehicle/$points?steps=true&geometries=geojson"; - } + $url = "http://94.130.163.243:$port/route/v1/$vehicle/$points?steps=true&geometries=geojson"; + $cacheHash = md5($url); if (Cache::has($cacheHash)) { $result = Cache::get($cacheHash); @@ -92,10 +90,7 @@ public function routingGeoJson($vehicle, $points, $bearingStartPoint = "") default: $port = 5000; } - $url = "http://maps.metager.de:$port/route/v1/$vehicle/$points?steps=true&alternatives=true&geometries=geojson&overview=full&annotations=true"; - if($port == 5002){ - $url = "http://94.130.163.243:$port/route/v1/$vehicle/$points?steps=true&alternatives=true&geometries=geojson&overview=full&annotations=true"; - } + $url = "http://94.130.163.243:$port/route/v1/$vehicle/$points?steps=true&alternatives=true&geometries=geojson&overview=full&annotations=true"; # Maybe we need to add Bearings: if ($bearingStartPoint !== "") { @@ -155,10 +150,8 @@ public function match($vehicle, $points, $timestamp, $radiuses) default: $port = 5000; } - $url = 'http://maps.metager.de:' . $port . '/match/v1/' . $vehicle . '/' . $points . '?steps=true&geometries=geojson×tamps=' . $timestamp . '&radiuses=' . $radiuses; - if($port == 5002){ - $url = "http://94.130.163.243" . $port . '/match/v1/' . $vehicle . '/' . $points . '?steps=true&geometries=geojson×tamps=' . $timestamp . '&radiuses=' . $radiuses; - } + $url = 'http://94.130.163.243:' . $port . '/match/v1/' . $vehicle . '/' . $points . '?steps=true&geometries=geojson×tamps=' . $timestamp . '&radiuses=' . $radiuses; + // make request $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url);