Spaces:
Build error
Build error
update map
Browse files
app.py
CHANGED
|
@@ -1,17 +1,42 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
st.
|
| 5 |
-
|
| 6 |
-
This is a playground for you to try Streamlit and have fun.
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
)
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 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)
|