# Northern.Lights.Map.Streamlit.Folium - write a streamlit python program that uses functions and user interface elements of a textbox, a dial, a four direction button array for up down left right and display a folium map with the data in python list dictionaries with these values: Aurora Spottings, Notifications on Nerthern Lights, Northern lights map location cities and countries for Iceland on a map written with folium for latitude and longitude of top ten places to view Northern Lights. Cite References as urls. import streamlit as st import folium from folium import Marker # Top 10 locations for viewing Northern Lights in Iceland 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): # Create a folium map centered in Iceland iceland_map = folium.Map(location=[64.9631, -19.0208], zoom_start=6) # Add markers for the top 10 locations for viewing Northern Lights for location in locations: Marker( [location["lat"], location["lon"]], popup=f"{location['name']}", ).add_to(iceland_map) return iceland_map # Streamlit app st.title("Top 10 Locations to View Northern Lights in Iceland") # Textbox user_text = st.text_input("Enter your text:") # Dial dial_value = st.slider("Select a value:", 0, 100) # Four-direction button array 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") # Display Folium map st.write("Top 10 locations for viewing the Northern Lights in Iceland:") folium_map = display_map(northern_lights_locations) from streamlit_folium import st_folium # center on Liberty Bell, add marker m = folium.Map(location=[39.949610, -75.150282], zoom_start=16) folium.Marker( [39.949610, -75.150282], popup="Liberty Bell", tooltip="Liberty Bell" ).add_to(m) # call to render Folium map in Streamlit st_data = st_folium(m, width=725) folium_static(folium_map) # Cite references 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) """ )