i want to add numbers inside folium markers based on one column in geodataframe.
Im expecting something like this Folium marker with number
In thispost they implemented it using BeautifyIcon.
Im using GeoPandas explore function with folium, so i dont know how to put the numbers without a loop like they do in the other post.
Here is what i tried, with no luck. Its just throws error "Object type series is not JSON serializable".
import folium.plugins as plugins
gdfNORTE.explore(
m=m,
marker_type='marker',
#marker_kwds={'icon': folium.map.Icon(icon='map-marker', prefix='fa')},
marker_kwds={'icon': (plugins.BeautifyIcon(icon="map-marker", icon_shape="marker", number=gdfNORTE["Cantidad de veces visitado"]))},
tooltip=["CALLE","NUMERO","ACT ECON","DESCRIPCION","CANT_TRAB","TRAB", "Cantidad de veces visitado"],
tooltip_kwds=dict(labels=True),
name="Domicilios visitados",
prefer_canvas=True,
)
Thanks.
Inspired by the linked Q/A, you can try this :
I'll be using the GeoDataFrame example used in the docs, to give you the general logic.
Output :