Update app.py
Browse files
app.py
CHANGED
@@ -599,24 +599,23 @@ elif option == "Symptom Checker":
|
|
599 |
|
600 |
elif option == "Doctor Connect":
|
601 |
st.subheader("π₯ Find a Doctor Near You")
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
folium_static(map_)
|
620 |
|
621 |
|
622 |
|
|
|
599 |
|
600 |
elif option == "Doctor Connect":
|
601 |
st.subheader("π₯ Find a Doctor Near You")
|
602 |
+
|
603 |
+
address = st.text_input("Enter your location (City, State or Latitude, Longitude):")
|
604 |
+
|
605 |
+
if address:
|
606 |
+
geolocator = Nominatim(user_agent="geoapi")
|
607 |
+
location = geolocator.geocode(address)
|
608 |
+
if location:
|
609 |
+
lat, lon = location.latitude, location.longitude
|
610 |
+
st.success(f"π Location detected: {location.address} ({lat}, {lon})")
|
611 |
+
|
612 |
+
map_ = folium.Map(location=[lat, lon], zoom_start=13)
|
613 |
+
folium.Marker([lat, lon], popup="You are here!", icon=folium.Icon(color="blue")).add_to(map_)
|
614 |
+
folium_static(map_)
|
615 |
+
else:
|
616 |
+
st.error("β Invalid address! Please try a different one.")
|
617 |
+
else:
|
618 |
+
st.info("βΉοΈ Please enter a location to view it on the map.")
|
|
|
619 |
|
620 |
|
621 |
|