Streamlit leafmap folium

Hi, does anyone know why this happens?

I’m trying to plot data from a netcdf file to a leafmap/folium map using this tutorial

However, the data is not showing up on the map

My app:

https://test-app.streamlit.app/

The code:

import leafmap.foliumap as leafmap
import streamlit as st

st.header(‘Test’)

filename = ‘wind_global.nc’
geojson = ‘https://github.com/opengeos/leafmap/raw/master/examples/data/countries.geojson
m = leafmap.Map(layers_control=True)
m.add_basemap(‘CartoDB.DarkMatter’)
m.add_velocity(filename, zonal_speed=‘u_wind’, meridional_speed=‘v_wind’)
m.to_streamlit()

thanks !

Hi @jp12,

Without knowing the exact error message you’re getting or having access to the data file you’re using, it’s difficult to diagnose the issue precisely.

Can you please provide more information?

Thanks,
Charly

Hi @Charly_Wargnier,

There are no console errors

The repository with the data and code for this app is here:

Thanks for your prompt feedback, @jp12!

From what you shared, it seems that you’re attempting to load a local file, ‘wind_global.nc,’ but it’s unclear if that file is correctly uploaded and accessible from the Streamlit app.

If the file isn’t uploaded correctly or can’t be accessed, no data will be displayed.

Can you please confirm that this has indeed been uploaded?

Thanks,
Charly

Hi @Charly_Wargnier , thanks !

You were correct, the filename was wrong.

Now, there’s a error on prompt

image

I’m not sure, but could you please check if the add_velocity function is supported by the foliumap backend of leafmap?

Thanks,
Charly