]> git.openstreetmap.org Git - rails.git/commitdiff
Directions, read "to" location in URL - fixes #998
authorSimon Legner <Simon.Legner@gmail.com>
Wed, 26 Aug 2015 19:38:39 +0000 (21:38 +0200)
committerSimon Legner <Simon.Legner@gmail.com>
Wed, 26 Aug 2015 19:38:39 +0000 (21:38 +0200)
app/assets/javascripts/index/directions.js

index a8615d3eb11339f3cc7c35a39a9f06d28f00fdb5..a5f3b00802c1afd68c9d5b4c58cf800e1ba6caec 100644 (file)
@@ -336,13 +336,8 @@ OSM.Directions = function (map) {
       setEngine(params.engine);
     }
 
-    if (params.from) {
-      endpoints[0].setValue(params.from);
-      endpoints[1].setValue("");
-    } else {
-      endpoints[0].setValue("");
-      endpoints[1].setValue("");
-    }
+    endpoints[0].setValue(params.from || "");
+    endpoints[1].setValue(params.to || "");
 
     var o = route[0] && L.latLng(route[0].split(',')),
         d = route[1] && L.latLng(route[1].split(','));