Don't call endpoint.setLatLng() from outside of endpoint module

This commit is contained in:
Anton Khorev 2024-08-11 05:13:36 +03:00
parent 7cd7db5718
commit e0df084e57

View file

@ -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);
});