Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import streamlit as st
|
2 |
import folium
|
3 |
from folium.plugins import MarkerCluster
|
4 |
-
from streamlit_folium import folium_static
|
5 |
import googlemaps
|
6 |
from datetime import datetime
|
7 |
import os
|
8 |
|
9 |
# Initialize Google Maps API client securely
|
10 |
-
gmaps = googlemaps.Client(key=os.getenv('
|
11 |
|
12 |
# Function to fetch directions
|
13 |
def get_directions_and_coords(source, destination):
|
@@ -63,7 +63,7 @@ if st.sidebar.button('Get Directions'):
|
|
63 |
st.write(f"{i+1}. {step['html_instructions']}")
|
64 |
st.subheader('Route on Map:')
|
65 |
m1 = render_folium_map(coords)
|
66 |
-
|
67 |
else:
|
68 |
st.write("No available routes.")
|
69 |
|
@@ -99,7 +99,7 @@ if location_input and medical_center_query:
|
|
99 |
popup=f"{name}\n{vicinity}\nRating: {rating}").add_to(m2)
|
100 |
|
101 |
# Render the map with medical centers
|
102 |
-
|
103 |
else:
|
104 |
st.write("No medical centers found matching your query.")
|
105 |
else:
|
|
|
1 |
import streamlit as st
|
2 |
import folium
|
3 |
from folium.plugins import MarkerCluster
|
4 |
+
from streamlit_folium import st_folium # Change here: import st_folium instead of folium_static
|
5 |
import googlemaps
|
6 |
from datetime import datetime
|
7 |
import os
|
8 |
|
9 |
# Initialize Google Maps API client securely
|
10 |
+
gmaps = googlemaps.Client(key=os.getenv('GOOGLE_KEY')) # Fetch API key from Hugging Face secrets
|
11 |
|
12 |
# Function to fetch directions
|
13 |
def get_directions_and_coords(source, destination):
|
|
|
63 |
st.write(f"{i+1}. {step['html_instructions']}")
|
64 |
st.subheader('Route on Map:')
|
65 |
m1 = render_folium_map(coords)
|
66 |
+
st_folium(m1) # Changed here to use st_folium instead of folium_static
|
67 |
else:
|
68 |
st.write("No available routes.")
|
69 |
|
|
|
99 |
popup=f"{name}\n{vicinity}\nRating: {rating}").add_to(m2)
|
100 |
|
101 |
# Render the map with medical centers
|
102 |
+
st_folium(m2) # Changed here to use st_folium instead of folium_static
|
103 |
else:
|
104 |
st.write("No medical centers found matching your query.")
|
105 |
else:
|