From: Tom Hughes Date: Sat, 1 Mar 2025 12:27:36 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/5739' X-Git-Tag: live~289 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/cf3c627c1ab7c64c219acc8ecff526f21db0c5e1?hp=4e9483e5eb8af1ee125b3ada96c5fa716176c490 Merge remote-tracking branch 'upstream/pull/5739' --- diff --git a/app/assets/favicons/manifest.json.erb b/app/assets/favicons/manifest.json.erb index 1666333a4..2e97cebc3 100644 --- a/app/assets/favicons/manifest.json.erb +++ b/app/assets/favicons/manifest.json.erb @@ -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", diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 97fa961d6..40ca85d96 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -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 = {};