|
|
|
import streamlit as st |
|
import folium |
|
from folium import Marker |
|
from streamlit_folium import folium_static |
|
|
|
|
|
northern_lights_locations = [ |
|
{"name": "Reykjavik", "lat": 64.1265, "lon": -21.8174}, |
|
{"name": "Akureyri", "lat": 65.6885, "lon": -18.1262}, |
|
{"name": "Vik", "lat": 63.4194, "lon": -19.0096}, |
|
{"name": "Hofn", "lat": 64.2539, "lon": -15.2082}, |
|
{"name": "Husavik", "lat": 66.0449, "lon": -17.3382}, |
|
{"name": "Grundarfjordur", "lat": 64.9226, "lon": -23.2543}, |
|
{"name": "Egilsstadir", "lat": 65.2669, "lon": -14.3948}, |
|
{"name": "Seydisfjordur", "lat": 65.2592, "lon": -14.0101}, |
|
{"name": "Isafjordur", "lat": 66.0750, "lon": -23.1266}, |
|
{"name": "Kirkjufell", "lat": 64.9426, "lon": -23.3061}, |
|
] |
|
|
|
def display_map(locations): |
|
|
|
iceland_map = folium.Map(location=[64.9631, -19.0208], zoom_start=6) |
|
|
|
|
|
for location in locations: |
|
Marker( |
|
[location["lat"], location["lon"]], |
|
popup=f"<b>{location['name']}</b>", |
|
).add_to(iceland_map) |
|
|
|
return iceland_map |
|
|
|
|
|
st.title("Top 10 Locations to View Northern Lights in Iceland") |
|
|
|
|
|
user_text = st.text_input("Enter your text:") |
|
|
|
|
|
dial_value = st.slider("Select a value:", 0, 100) |
|
|
|
|
|
st.write("Four-direction button array:") |
|
col1, col2, col3 = st.columns(3) |
|
with col2: |
|
st.button("Up") |
|
with col1: |
|
st.button("Left") |
|
with col3: |
|
st.button("Right") |
|
with col2: |
|
st.button("Down") |
|
|
|
|
|
st.write("Top 10 locations for viewing the Northern Lights in Iceland:") |
|
folium_map = display_map(northern_lights_locations) |
|
folium_static(folium_map) |
|
|
|
|
|
st.write( |
|
""" |
|
References: |
|
- [Folium documentation](https://python-visualization.github.io/folium/) |
|
- [Streamlit documentation](https://docs.streamlit.io/) |
|
- [Top 10 locations](https://www.guidetoiceland.is/best-of-iceland/top-10-places-to-see-the-northern-lights) |
|
""" |
|
) |
|
|