stephanus88 commited on
Commit
b4dbd8b
·
verified ·
1 Parent(s): 888ccff

update map

Browse files
Files changed (1) hide show
  1. app.py +37 -12
app.py CHANGED
@@ -1,17 +1,42 @@
1
  import streamlit as st
 
 
2
 
3
- st.title("Hello Streamlit-er 👋")
4
- st.markdown(
5
- """
6
- This is a playground for you to try Streamlit and have fun.
7
 
8
- **There's :rainbow[so much] you can build!**
9
-
10
- We prepared a few examples for you to get started. Just
11
- click on the buttons above and discover what you can do
12
- with Streamlit.
13
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  )
15
 
16
- if st.button("Send balloons!"):
17
- st.balloons()
 
1
  import streamlit as st
2
+ import plotly.express as px
3
+ import pandas as pd
4
 
5
+ # Page setup
6
+ st.set_page_config(page_title="Yogyakarta Map Markers", layout="wide")
7
+ st.title("📍 10 Markers in Yogyakarta")
 
8
 
9
+ # 10 example points in Yogyakarta
10
+ locations = [
11
+ {"name": "Malioboro Street", "lat": -7.792778, "lon": 110.365833},
12
+ {"name": "Kraton Yogyakarta", "lat": -7.8056, "lon": 110.3647},
13
+ {"name": "Taman Sari", "lat": -7.8131, "lon": 110.3592},
14
+ {"name": "Gembira Loka Zoo", "lat": -7.7969, "lon": 110.3958},
15
+ {"name": "Prambanan Temple", "lat": -7.7520, "lon": 110.4910},
16
+ {"name": "Ullen Sentalu Museum", "lat": -7.5824, "lon": 110.4307},
17
+ {"name": "Merapi Volcano Museum", "lat": -7.6072, "lon": 110.4425},
18
+ {"name": "Alun-Alun Kidul", "lat": -7.8121, "lon": 110.3633},
19
+ {"name": "Tugu Yogyakarta", "lat": -7.7829, "lon": 110.3671},
20
+ {"name": "Affandi Museum", "lat": -7.7823, "lon": 110.3985}
21
+ ]
22
+
23
+ # Convert to DataFrame
24
+ df = pd.DataFrame(locations)
25
+
26
+ # Plotly scatter mapbox
27
+ fig = px.scatter_mapbox(
28
+ df,
29
+ lat="lat",
30
+ lon="lon",
31
+ hover_name="name",
32
+ zoom=11,
33
+ height=600
34
+ )
35
+
36
+ fig.update_layout(
37
+ mapbox_style="open-street-map",
38
+ margin={"r":0, "t":0, "l":0, "b":0}
39
  )
40
 
41
+ # Show map
42
+ st.plotly_chart(fig, use_container_width=True)