]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/3073'
authorTom Hughes <tom@compton.nu>
Thu, 28 Jan 2021 10:36:38 +0000 (10:36 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 28 Jan 2021 10:36:38 +0000 (10:36 +0000)
app/assets/javascripts/index.js
app/assets/javascripts/index/directions.js

index 68beefeb6a7f4fa5122c2629c4254a8d01cc8f04..10f28ef9232b3c903aecd08d00fb725f9b6ad6b9 100644 (file)
@@ -108,9 +108,9 @@ $(document).ready(function () {
     iconLoading: "icon geolocate",
     strings: {
       title: I18n.t("javascripts.map.locate.title"),
-      metersUnit: I18n.t("javascripts.map.locate.metersUnit"),
-      feetUnit: I18n.t("javascripts.map.locate.feetUnit"),
-      popup: I18n.t("javascripts.map.locate.popup")
+      popup: function (options) {
+        return I18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
+      }
     }
   }).addTo(map);
 
index 6efde27c6a91dde0f3983fd1ccc2c560fac7c0f7..ee44ad4c4be11be9db4ae5a9f684f0a11232b730 100644 (file)
@@ -335,9 +335,7 @@ OSM.Directions = function (map) {
   select.on("change", function (e) {
     chosenEngine = engines[e.target.selectedIndex];
     $.cookie("_osm_directions_engine", chosenEngine.id, { expires: expiry, path: "/" });
-    if (map.hasLayer(polyline)) {
-      getRoute(true, true);
-    }
+    getRoute(true, true);
   });
 
   $(".directions_form").on("submit", function (e) {