DreamStream-1 commited on
Commit
cb36e00
·
verified ·
1 Parent(s): 31fa9ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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('GOOGLE_API_KEY')) # Fetch API key from Hugging Face secrets
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
- folium_static(m1)
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
- folium_static(m2)
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: