From: Anton Khorev Date: Thu, 10 Apr 2025 15:49:42 +0000 (+0300) Subject: Add zoom parameter to 'Show address' in context menu X-Git-Tag: live~45^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/c2d62cb2e6e17b166cce4207de82ae5be885892e?ds=sidebyside Add zoom parameter to 'Show address' in context menu --- 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 })); } });