Add layer menu in streamlit leafmap foliumap

Summary

Hello

i would like to add a layer in the right menu like the heatmap layer which could be activated by clicking on it.
This additionnal layer will plot markers wit gps coordinates but when i try to use add_xy_data() but i got this message :

NotImplementedError: The folium plotting backend does not support this function. Use the ipyleaflet plotting backend instead.

Steps to reproduce

Code snippet:

import leafmap.foliumap as leafmap

m = leafmap.Map(center=[lat, lng], zoom=12)
m.add_marker(location=[lat, lng], popup=[lat, lng])
m.add_heatmap(
    df,
    latitude="lat",
    longitude="lon",
    value="quant_feature",
    name="Heat map",
    radius=20,
)

m.add_xy_data(df2, 
              x='consolidated_longitude',
              y='consolidated_latitude',
              layer_name='Marker cluster')

m.to_streamlit()

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.