The L.GeoJSON
layer group is just a Feature Group with extra methods specific for vector layers.
It provides a convenient conversion from a GeoJSON data object into a layer group made of Leaflet vector shapes converted from the GeoJSON data. In particular, a LineString
is converted into an L.Polyline
.
So your L.GeoJSON
group is in the end just a container for your Polylines.
Therefore you can directly add and remove child layers like with a normal group (addLayer
and removeLayer
methods). You can add and remove child Polylines, whether built automatically at construction from the GeoJSON object, or added later on through addLayer
(or even through addData
).
If you want to shorten / extend a Polyline (through spliceLatLngs
and addLatLng
methods), of course you can also do it, provided that you get the direct reference to your Polyline.
GeoJson
, are you talking about theL.GeoJSON
layer group or the GeoJSON data format?