From c2d62cb2e6e17b166cce4207de82ae5be885892e Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Thu, 10 Apr 2025 18:49:42 +0300 Subject: [PATCH] Add zoom parameter to 'Show address' in context menu --- app/assets/javascripts/index/contextmenu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/index/contextmenu.js b/app/assets/javascripts/index/contextmenu.js index 4c157e6e0..dcdfc9e44 100644 --- a/app/assets/javascripts/index/contextmenu.js +++ b/app/assets/javascripts/index/contextmenu.js @@ -35,9 +35,10 @@ OSM.initializeContextMenu = function (map) { map.contextmenu.addItem({ text: OSM.i18n.t("javascripts.context.show_address"), callback: function describeLocation(e) { - const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom()); + const zoom = map.getZoom(); + const [lat, lon] = OSM.cropLocation(e.latlng, zoom); - OSM.router.route("/search?" + new URLSearchParams({ lat, lon })); + OSM.router.route("/search?" + new URLSearchParams({ lat, lon, zoom })); } }); -- 2.39.5