X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7cd7db571824a583229be914d56652517540452c..e0df084e573f1ac5402e0e4c458f516cf374872d:/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); });