-
-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lonboard map to_streamlit #594
Comments
lonboard has the to_html() method. It should be straightforward to add a to_streamlit() method, similar to the folium method. I will add that when I have time. Contributions are welcome. |
It appears the HTML generated by lonboard has something special. It does not work with the streamlit html component. See #600. I don't have a solution yet. |
The same method works fine for folium maps. |
@giswqs do you have an example of this? in my testing I'm just getting a literal data item back, import streamlit as st
import leafmap.deckgl as lonboard
st.set_page_config(page_title="Lonboard Test")
m = lonboard.Map(center=[35, -100], zoom=3)
m.to_streamlit() |
I have not used lonboard recently. The lonbard might have changed. Let me know look into it. |
This seems a lonboard problem. The def to_streamlit(
self,
width: Optional[int] = None,
height: Optional[int] = 600,
scrolling: Optional[bool] = False,
**kwargs,
):
try:
import streamlit.components.v1 as components
return components.html(
self.to_html(), width=width, height=height, scrolling=scrolling
)
except Exception as e:
raise e
|
Leafmap is fantastic and it's great to see support for lonboard already. I'm not sure how easy or difficult it would be to add a to_streamlit method for lonboard maps, but this would be useful for me!
The text was updated successfully, but these errors were encountered: