Fix layout jumping with fixed height container
Browse files- app.py +1 -1
- ui/map_viewer.py +3 -0
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
Traffic Accident Reconstruction
|
| 3 |
======================================
|
| 4 |
Main Streamlit Application
|
| 5 |
Huawei AI Innovation Challenge 2026
|
|
|
|
| 1 |
"""
|
| 2 |
+
Traffic Accident Reconstruction System
|
| 3 |
======================================
|
| 4 |
Main Streamlit Application
|
| 5 |
Huawei AI Innovation Challenge 2026
|
ui/map_viewer.py
CHANGED
|
@@ -431,5 +431,8 @@ def render_results_map(scenarios: list, selected_scenario: int = 0):
|
|
| 431 |
icon=folium.Icon(color='purple', icon='info-sign')
|
| 432 |
).add_to(m)
|
| 433 |
|
|
|
|
|
|
|
| 434 |
# Display map using static version to prevent jumping
|
| 435 |
folium_static(m, width=700, height=500)
|
|
|
|
|
|
| 431 |
icon=folium.Icon(color='purple', icon='info-sign')
|
| 432 |
).add_to(m)
|
| 433 |
|
| 434 |
+
# Add fixed height container to prevent layout shift
|
| 435 |
+
st.markdown('<div style="min-height: 500px;">', unsafe_allow_html=True)
|
| 436 |
# Display map using static version to prevent jumping
|
| 437 |
folium_static(m, width=700, height=500)
|
| 438 |
+
st.markdown('</div>', unsafe_allow_html=True)
|