MayankGupta06 commited on
Commit
2bd190f
Β·
verified Β·
1 Parent(s): cf2d18a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -18
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
- lat, lon = get_user_location()
603
-
604
- if lat is None or lon is None:
605
- st.warning("Unable to fetch location. Please allow location access or enter manually.")
606
- address = st.text_input("Enter your location (City, State or Latitude, Longitude):")
607
- if address:
608
- geolocator = Nominatim(user_agent="geoapi")
609
- location = geolocator.geocode(address)
610
- if location:
611
- lat, lon = location.latitude, location.longitude
612
- else:
613
- st.error("Invalid address! Try again.")
614
-
615
- if lat and lon:
616
- st.success(f"πŸ“ Location detected: {lat}, {lon}")
617
- map_ = folium.Map(location=[lat, lon], zoom_start=13)
618
- folium.Marker([lat, lon], popup="You are here!", icon=folium.Icon(color="blue")).add_to(map_)
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