- var precision = OSM.zoomPrecision(map.getZoom());
- var value = ll.lat.toFixed(precision) + ", " + ll.lng.toFixed(precision);
- var llWithPrecision = L.latLng(ll.lat.toFixed(precision), ll.lng.toFixed(precision));
- endpoints[type === "from" ? 0 : 1].setValue(value, llWithPrecision);
+ const llWithPrecision = OSM.cropLocation(ll, map.getZoom());
+ endpoints[type === "from" ? 0 : 1].setValue(llWithPrecision.join(", "), llWithPrecision);