From b9d4642292bac96dc07a553dc315a2ca97a8f769 Mon Sep 17 00:00:00 2001
From: Dominik Pfennig <dominik@suma-ev.de>
Date: Mon, 7 May 2018 13:57:59 +0200
Subject: [PATCH] =?UTF-8?q?Testweise=20Autoroute=20f=C3=BCr=20Europa=20akt?=
 =?UTF-8?q?iviert.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/Http/Controllers/RoutingController.php | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/app/Http/Controllers/RoutingController.php b/app/Http/Controllers/RoutingController.php
index 588e206..af52386 100644
--- a/app/Http/Controllers/RoutingController.php
+++ b/app/Http/Controllers/RoutingController.php
@@ -39,6 +39,9 @@ public function routingOverviewGeoJson($vehicle, $points)
                 $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";
+        }
         $cacheHash = md5($url);
         if (Cache::has($cacheHash)) {
             $result = Cache::get($cacheHash);
@@ -90,6 +93,9 @@ public function routingGeoJson($vehicle, $points, $bearingStartPoint = "")
                 $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";
+        }
 
         # Maybe we need to add Bearings:
         if ($bearingStartPoint !== "") {
@@ -150,7 +156,9 @@ public function match($vehicle, $points, $timestamp, $radiuses)
                 $port = 5000;
         }
         $url = 'http://maps.metager.de:' . $port . '/match/v1/' . $vehicle . '/' . $points . '?steps=true&geometries=geojson&timestamps=' . $timestamp . '&radiuses=' . $radiuses;
-
+        if($port == 5002){
+            $url       = "http://94.130.163.243" . $port . '/match/v1/' . $vehicle . '/' . $points . '?steps=true&geometries=geojson&timestamps=' . $timestamp . '&radiuses=' . $radiuses;
+        }
         // make request
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
-- 
GitLab