I almost repeated Color-code a Leaflet polyline based on additional values, e.g. altitude, speed, because after more than eight years, I have not found a satisfactory answer.
I need a gradien color of a GeoJSON LineString object.
The style
option of L.GeoJSON
object allows to specify only solid color.
The available extensions allow creating only an L.Polyline
object with gradient color (this and this, for example).
But I update my line dynamically in real time, so it should be an L.GeoJSON
object.
Can anyone suggest an idea or solution how to make a gradient color of the line exactly in a L.GeoJSON
object?
style
option of L.GeoJSON object.