]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5739'
authorTom Hughes <tom@compton.nu>
Sat, 1 Mar 2025 12:27:36 +0000 (12:27 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 1 Mar 2025 12:27:36 +0000 (12:27 +0000)
app/assets/favicons/manifest.json.erb
app/assets/javascripts/index/directions.js

index 1666333a4e78893cd47d68401a1e1271ed4f067a..2e97cebc3247e3f4ac25aa90401d67dec766422c 100644 (file)
@@ -2,11 +2,15 @@
        "name": "OpenStreetMap",
        "short_name": "OSM",
        "icons": <%= [36, 48, 72, 96, 144, 192].map { |res| {
-                       src: image_path("android-chrome-#{res}x#{res}.png").gsub("/", "\\/"),
+                       src: image_path("android-chrome-#{res}x#{res}.png"),
                        sizes: "#{res}x#{res}",
                        type: "image/png",
                        density: res.to_f / 48
-               } }.to_json %>,
+               } }.push({
+                       src: image_path("../images/osm_logo.svg"),
+                       sizes: "any",
+                       type: "image/svg+xml"
+               }).to_json %>,
        "start_url": "/",
        "theme_color": "#7ebc6f",
        "background_color": "#fff",
index 97fa961d6993f141addd4718fef24839a9fbec66..40ca85d960fc6f0d29504761a1bb8eeb2b4ab581 100644 (file)
@@ -273,13 +273,15 @@ OSM.Directions = function (map) {
     map.fire("startinglocation", { latlng: [lat, lng] });
   }
 
+  function startingLocationListener({ latlng }) {
+    if (endpoints[0].value) return;
+    endpoints[0].setValue(latlng.join(", "));
+  }
+
   map.on("locationfound", ({ latlng: { lat, lng } }) =>
     lastLocation = [lat, lng]
   ).on("locateactivate", () => {
-    map.once("startinglocation", ({ latlng }) => {
-      if (endpoints[0].value) return;
-      endpoints[0].setValue(latlng.join(", "));
-    });
+    map.once("startinglocation", startingLocationListener);
   });
 
   const page = {};