streamlit-folium icon indicating copy to clipboard operation
streamlit-folium copied to clipboard

Scrolling in one direction causing build up in lng variables

Open wrenchInTheWorks opened this issue 11 months ago • 5 comments
trafficstars

When scrolling even on the example the lng builds up when you warp around the world. Screenshot 2024-11-29 at 8 48 34 PM

This is my first time posting an issue anywhere please let me know if I need include any other information.

wrenchInTheWorks avatar Nov 29 '24 07:11 wrenchInTheWorks

Hi @wrenchInTheWorks -

When you say "build up", you're talking about the values being outside of the -180, 180 bounds?

randyzwitch avatar Dec 02 '24 20:12 randyzwitch

It appears this is the default behavior in leaflet (the library that Folium wraps, that we wrap for this package 😅):

https://stackoverflow.com/questions/18063278/leaflet-getbounds-returning-longitudes-greater-than-180

@blackary, I'm not sure I even understand why you'd not want to wrap the values. Do you think we should add a keyword argument to st_folium?

randyzwitch avatar Dec 10 '24 19:12 randyzwitch

Hi Randy, Apologies for not getting back to you.

Yes, I was informed by my flatmate who is a geographer this is quite common for maps to do, my apologies for creating a fuss.

@blackary, I'm not sure I even understand why you'd not want to wrap the values. Do you think we should add a keyword argument to st_folium?

I'm passing values from a drawn box on the map to open topography which needs wrapped coordinates to download DEMs.

I will wrap the values in my code.

Cheers, Michael

Michael-3Scape avatar Dec 10 '24 23:12 Michael-3Scape

No bother at all, it's definitely a weird default!

randyzwitch avatar Dec 11 '24 17:12 randyzwitch

Turns out, this is the same as #145

randyzwitch avatar Feb 20 '25 21:02 randyzwitch