From e0df084e573f1ac5402e0e4c458f516cf374872d Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sun, 11 Aug 2024 05:13:36 +0300 Subject: [PATCH] Don't call endpoint.setLatLng() from outside of endpoint module --- app/assets/javascripts/index/directions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index ccd4a68c2..974a40e85 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -300,7 +300,9 @@ OSM.Directions = function (map) { var pt = L.DomEvent.getMousePosition(oe, map.getContainer()); // co-ordinates of the mouse pointer at present pt.y += 20; var ll = map.containerPointToLatLng(pt); - endpoints[type === "from" ? 0 : 1].setLatLng(ll); + var precision = OSM.zoomPrecision(map.getZoom()); + var value = ll.lat.toFixed(precision) + ", " + ll.lng.toFixed(precision); + endpoints[type === "from" ? 0 : 1].setValue(value, ll); getRoute(true, true); }); -- 2.39.5