You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that since a change in Leaflet v1.8.0, which included this PR: Leaflet/Leaflet#7800, the font size for various map elements in streamlit-folium has shrunk to 7.5px. This effects the atribution, a scalebar, any popup text and probalby other elements. This is most easily seen in the live examples at https://folium.streamlit.app/ where all of these are very small.
This seems to be caused by the relative font-size setting which was introduced in the PR above, but it is also interacting with a font-size setting which is being inherited from the bootstrap-glyphicons.css file which is dynamically added. This adds a font-size: 62.5% attribute to the <html> element of the streamlit-folium iframe, causing the reference font size for the iframe to drop from 16px to 10px. This the reduces further due to Leaflet's font-size: 0.75rem setting, dropping it to 7.5px.
Direct Folium users don't have this issue because they don't inherit font-size from the glyphicons-bootstrap.css file or as per the PR above, they can set the font-size of the leaflet-container element.
It can be resolved by removing the glyphicon-boostrap.css from the map object, but this might affect some other situations if people are using glyphicons:
It seems that since a change in Leaflet v1.8.0, which included this PR: Leaflet/Leaflet#7800, the font size for various map elements in streamlit-folium has shrunk to 7.5px. This effects the atribution, a scalebar, any popup text and probalby other elements. This is most easily seen in the live examples at https://folium.streamlit.app/ where all of these are very small.
This seems to be caused by the relative font-size setting which was introduced in the PR above, but it is also interacting with a font-size setting which is being inherited from the
bootstrap-glyphicons.css
file which is dynamically added. This adds afont-size: 62.5%
attribute to the<html>
element of the streamlit-folium iframe, causing the reference font size for the iframe to drop from 16px to 10px. This the reduces further due to Leaflet'sfont-size: 0.75rem
setting, dropping it to 7.5px.Direct Folium users don't have this issue because they don't inherit font-size from the glyphicons-bootstrap.css file or as per the PR above, they can set the font-size of the leaflet-container element.
It can be resolved by removing the glyphicon-boostrap.css from the map object, but this might affect some other situations if people are using glyphicons:
A better solution might be to force a
font-size: 1rem
attribute in the<html>
tag in the relevant template in streamlit-folium:streamlit-folium/streamlit_folium/frontend/public/index.html
Line 2 in 58b14d7
I think this issue will disappear in future Leaflet updates, because I don't think this css is used in more recent versions of Bootstrap.
The text was updated successfully, but these errors were encountered: