File size: 1,426 Bytes
8e133c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import streamlit as st
import folium
from streamlit_folium import folium_static

# Define mythological places data for Iceland
mythological_places = [
    ('Ásbyrgi', 66.0082, -16.5096),
    ('Dimmuborgir', 65.6083, -16.8996),
    ('Hekla', 63.9920, -19.6656),
    ('Elliðaey', 63.4845, -20.2785),
    ('Mývatn', 65.6039, -16.9965),
    ('Djúpalónssandur', 64.7439, -23.9033),
    ('Reykjadalur', 64.0333, -21.2167),
    ('Snaefellsjokull', 64.8080, -23.7767),
    ('Jokulsarlon', 64.0784, -16.2300),
    ('Vatnajokull', 64.4150, -16.8333)
]

# Create a map centered on Iceland
m = folium.Map(location=[65.0, -18.0], zoom_start=7)

# Add markers for each mythological place
for place in mythological_places:
    folium.Marker(
        location=[place[1], place[2]],
        popup=f'{place[0]}',
        icon=folium.Icon(color='red')
    ).add_to(m)

# Function to update the map when a button is clicked
def update_map(place_data):
    m.location = [place_data[1], place_data[2]]
    m.zoom_start = 13
    folium_static(m)

# Create a grid of buttons for selecting mythological places
for i in range(0, len(mythological_places), 3):
    cols = st.columns(3)
    for j in range(3):
        if i + j < len(mythological_places):
            with cols[j]:
                if st.button(mythological_places[i + j][0]):
                    update_map(mythological_places[i + j])

# Display the map in Streamlit
folium_static(m)