how to update the marker on a geospatial map plotted using folium python?

Viewed 207

I am new to Folium and I wish to plot a map using folium.I am doing kafka data streaming and I write a code to consume the data frome kafka server. The message contains of the latitude and longitude of the marker to be plotted on the map.

I created a for loop to read the streaming data and set a base map. Then for each batch of incoming data, it is appended into a list.

For instance, there are 5 markers to be plotted on the map, the latitude and longitude will be stored in a list of tuple named location [(lat,long),(lat,long),(lat,long),(lat,long),(lat,long)]

Then, based on the location list, i will read the the coordinates and add the marker to the based map and display it. The code is shown in the sceenshot below. enter image description here

I would like to display 1 single map and update the marker location every time a new batch of data is appended to the list instead of displaying a new map every time updating the marker location.

0 Answers
Related