perliedman / leaflet-realtime

Put realtime data on a Leaflet map
ISC License
743 stars 167 forks source link

How to show result in linestring and with marker at every point ? #155

Closed sakjain02 closed 4 years ago

sakjain02 commented 4 years ago

Can't get the source to change the linestring colour.

perliedman commented 4 years ago

Leaflet Realtime really only displays the GeoJSON you give it, so if you need to display a LineString and a set of Markers, you would have to provide that GeoJSON. With a custom source function (described in the docs), you can easily convert a server response from a LineString to a FeatureCollection with the LineString as well as the Markers.

Regarding LineString color, what have you tried? This should work if you provide a style function or provide the onEachFeature option.

sakjain02 commented 4 years ago

Thank you. But I solved the problem. I have used the realtime update feature to get the LineString by joining every point with matching colour.