Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -212,23 +212,26 @@ def page_vacation():
|
|
| 212 |
# Convert the route to a DataFrame
|
| 213 |
route_df = pd.DataFrame(route, columns=['lon', 'lat'])
|
| 214 |
|
|
|
|
|
|
|
|
|
|
| 215 |
# Display the route using PyDeck
|
| 216 |
st.pydeck_chart(pdk.Deck(
|
| 217 |
map_style='mapbox://styles/mapbox/light-v9',
|
| 218 |
initial_view_state=pdk.ViewState(
|
| 219 |
-
latitude=48.5216,
|
| 220 |
-
longitude=9.0576,
|
| 221 |
zoom=11,
|
| 222 |
-
pitch=
|
| 223 |
),
|
| 224 |
layers=[
|
| 225 |
pdk.Layer(
|
| 226 |
-
'
|
| 227 |
-
data=
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
pickable=True
|
| 233 |
),
|
| 234 |
],
|
|
|
|
| 212 |
# Convert the route to a DataFrame
|
| 213 |
route_df = pd.DataFrame(route, columns=['lon', 'lat'])
|
| 214 |
|
| 215 |
+
# Create the route data for PyDeck, making sure each coordinate pair is a list within the 'path' list
|
| 216 |
+
route_data = [{'path': route}]
|
| 217 |
+
|
| 218 |
# Display the route using PyDeck
|
| 219 |
st.pydeck_chart(pdk.Deck(
|
| 220 |
map_style='mapbox://styles/mapbox/light-v9',
|
| 221 |
initial_view_state=pdk.ViewState(
|
| 222 |
+
latitude=48.5216, # This should ideally be the midpoint of the route
|
| 223 |
+
longitude=9.0576, # This should ideally be the midpoint of the route
|
| 224 |
zoom=11,
|
| 225 |
+
pitch=0,
|
| 226 |
),
|
| 227 |
layers=[
|
| 228 |
pdk.Layer(
|
| 229 |
+
'PathLayer',
|
| 230 |
+
data=route_data,
|
| 231 |
+
get_path='path',
|
| 232 |
+
width_scale=20,
|
| 233 |
+
width_min_pixels=2,
|
| 234 |
+
get_color=[255, 140, 0], # Color the path with a visible color
|
| 235 |
pickable=True
|
| 236 |
),
|
| 237 |
],
|