Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -135,45 +135,30 @@ def page_article_to_social_post():
|
|
| 135 |
st.write(post_content)
|
| 136 |
|
| 137 |
def page_vaccation():
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
# Assume function to calculate route and places of interest (mock data for demonstration)
|
| 147 |
-
# You would replace this with real data obtained from mapping APIs
|
| 148 |
-
route_data = pd.DataFrame({
|
| 149 |
-
'lat': [start_lat, end_lat],
|
| 150 |
-
'lon': [start_lon, end_lon]
|
| 151 |
-
})
|
| 152 |
-
places_of_interest = pd.DataFrame({
|
| 153 |
-
'lat': [poi1_lat, poi2_lat], # Latitudes of places of interest
|
| 154 |
-
'lon': [poi1_lon, poi2_lon], # Longitudes of places of interest
|
| 155 |
-
'name': ['Place 1', 'Place 2'] # Names of places of interest
|
| 156 |
-
})
|
| 157 |
|
| 158 |
-
|
| 159 |
-
st.
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
),
|
| 175 |
-
],
|
| 176 |
-
))
|
| 177 |
|
| 178 |
|
| 179 |
# Setup the sidebar with page selection
|
|
|
|
| 135 |
st.write(post_content)
|
| 136 |
|
| 137 |
def page_vaccation():
|
| 138 |
+
|
| 139 |
+
st.title("Map Display with Start and End Points")
|
| 140 |
+
|
| 141 |
+
# Collect user inputs for latitude and longitude of start and end points
|
| 142 |
+
st.header("Start Point")
|
| 143 |
+
start_lat = st.number_input("Start Latitude", value=37.76, format="%.6f")
|
| 144 |
+
start_lon = st.number_input("Start Longitude", value=-122.4, format="%.6f")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
+
st.header("End Point")
|
| 147 |
+
end_lat = st.number_input("End Latitude", value=37.76, format="%.6f")
|
| 148 |
+
end_lon = st.number_input("End Longitude", value=-122.41, format="%.6f")
|
| 149 |
+
|
| 150 |
+
# Prepare data for the map
|
| 151 |
+
if start_lat and start_lon and end_lat and end_lon:
|
| 152 |
+
points_df = pd.DataFrame({
|
| 153 |
+
'lat': [start_lat, end_lat],
|
| 154 |
+
'lon': [start_lon, end_lon],
|
| 155 |
+
'color': ['#ff0000', '#0000ff'], # Start in red, end in blue
|
| 156 |
+
'size': [100, 100] # Size of the points
|
| 157 |
+
})
|
| 158 |
+
|
| 159 |
+
# Display the map with customized points
|
| 160 |
+
st.map(data=points_df, latitude='lat', longitude='lon', color='color', size='size')
|
| 161 |
+
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
|
| 164 |
# Setup the sidebar with page selection
|