Hello,
Hello, I have a rendering issue between Folium and st_folium.
Indeed, st_folium doesn’t display the numbers in my bubbles. With Folium, I use the icons fa-1, fa-2,…
And when I use st_folium, the numbers in the markers disappear.
Have you ever encountered this issue?
edsaac
February 8, 2024, 8:36pm
2
Yes, it looks like a bug in st_folium to me.
Code
import streamlit as st
import folium
from folium.map import Icon
from streamlit_folium import st_folium
st.set_page_config(layout='wide')
m = folium.Map(location=[39.949610, -75.13282], zoom_start=14, height=500)
icons_list = ["1", "2", "3", "star", "heart"]
for i, icon in enumerate(icons_list):
folium.Marker(
[39.949610, -75.150282 + i/100],
icon=Icon(icon=icon, prefix='fa', color='red', icon_color='white')
).add_to(m)
cols = st.columns(2)
with cols[0]:
"## Using `components.html`"
st.components.v1.html(
m.get_root()._repr_html_(), height=500,
)
with cols[1]:
"## Using `st_folium`"
st_folium(m, returned_objects=[], use_container_width=True, height=500)
1 Like
Hi @edsaac ,
I’m not alone
how to report this problem for correction?
edsaac
February 8, 2024, 9:09pm
4
You could raise an issue at their repository. I believe @randyzwitch here was the maintainer.
1 Like
Thank you
I have use your code and picture to explain the problem.
and I mentioned your name
@edsaac , the version 0.20 of streamlit_folium solve the problem:
see the answer from github
Difference icon_type between folium and st_folium · Issue #170 · randyzwitch/streamlit-folium · GitHub
Thank you for your help!
1 Like
system
Closed
May 4, 2024, 12:31pm
7
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.