]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions.js
Merge pull request #4919 from rkoeze/rkoeze/add-github-pr-template
[rails.git] / app / assets / javascripts / index / directions.js
index 7e8c18fb8cdaafd6d0d0ace0542a8a780d5eadb3..391c1f9315c7fe945d822d49380f9578729e79c0 100644 (file)
@@ -287,7 +287,8 @@ OSM.Directions = function (map) {
       var ll = map.containerPointToLatLng(pt);
       var precision = OSM.zoomPrecision(map.getZoom());
       var value = ll.lat.toFixed(precision) + ", " + ll.lng.toFixed(precision);
-      endpoints[type === "from" ? 0 : 1].setValue(value, ll);
+      var llWithPrecision = L.latLng(ll.lat.toFixed(precision), ll.lng.toFixed(precision));
+      endpoints[type === "from" ? 0 : 1].setValue(value, llWithPrecision);
     });
 
     endpoints[0].enable();