Prior to Leaflet 1.0, I used the spliceLatLngs method to place coordinates inside a polyline object, for example:
line.spliceLatLngs(index, 1, new L.LatLng(lat, lng));
However, with a recent update, spliceLatLngs has been reorganized due to the way the new polylines have nested coordinate arrays.
I tried to make such an alternative:
var latLngs = line.getLatLngs();
But with this alternative, it seems to get rid of the final coordinate. :(
Did I just skip something obvious to connect the coordinate to an existing polyline?
Thank you in advance!
source share