X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fd7840d5f16f21431fb4f0b1d62387cd045b1da4..f65593651f17f1bb2caa6a757ca377c094ea7a02:/app/assets/javascripts/index/directions.js 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); });