Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,11 +45,11 @@ def add_medical_center_paths(m, source, med_centers):
|
|
45 |
).add_to(m)
|
46 |
|
47 |
# Streamlit UI
|
48 |
-
st.title('Google Maps and
|
49 |
st.sidebar.header('Directions')
|
50 |
|
51 |
-
source_location = st.sidebar.text_input("Source Location", "
|
52 |
-
destination_location = st.sidebar.text_input("Destination Location", "
|
53 |
|
54 |
if st.sidebar.button('Get Directions'):
|
55 |
steps, coords = get_directions_and_coords(source_location, destination_location)
|
@@ -63,23 +63,23 @@ if st.sidebar.button('Get Directions'):
|
|
63 |
else:
|
64 |
st.write("No available routes.")
|
65 |
|
66 |
-
# Top 10 medical centers in
|
67 |
-
|
68 |
-
('
|
69 |
-
('
|
70 |
-
('
|
71 |
-
('
|
72 |
-
('
|
73 |
-
('
|
74 |
-
('
|
75 |
-
('
|
76 |
-
('
|
77 |
-
('
|
78 |
]
|
79 |
|
80 |
# Annotate distances and paths for each medical center
|
81 |
-
st.markdown("## π₯
|
82 |
-
m2 = folium.Map(location=[
|
83 |
marker_cluster = MarkerCluster().add_to(m2)
|
84 |
-
add_medical_center_paths(m2, source_location,
|
85 |
folium_static(m2)
|
|
|
45 |
).add_to(m)
|
46 |
|
47 |
# Streamlit UI
|
48 |
+
st.title('Google Maps and Massachusetts Medical Centers π')
|
49 |
st.sidebar.header('Directions')
|
50 |
|
51 |
+
source_location = st.sidebar.text_input("Source Location", "Logan International Airport, Boston, MA")
|
52 |
+
destination_location = st.sidebar.text_input("Destination Location", "Boston Harbor, MA")
|
53 |
|
54 |
if st.sidebar.button('Get Directions'):
|
55 |
steps, coords = get_directions_and_coords(source_location, destination_location)
|
|
|
63 |
else:
|
64 |
st.write("No available routes.")
|
65 |
|
66 |
+
# Top 10 medical centers in Massachusetts
|
67 |
+
massachusetts_med_centers = [
|
68 |
+
('Massachusetts General Hospital', 42.3626, -71.0704, 'Teaching hospital', 'Boston'),
|
69 |
+
('Brigham and Women\'s Hospital', 42.3356, -71.1077, 'Teaching hospital', 'Boston'),
|
70 |
+
('Dana-Farber Cancer Institute', 42.3371, -71.1081, 'Cancer specialty', 'Boston'),
|
71 |
+
('Beth Israel Deaconess Medical Center', 42.3394, -71.1043, 'Teaching hospital', 'Boston'),
|
72 |
+
('Boston Children\'s Hospital', 42.3671, -71.1077, 'Pediatrics', 'Boston'),
|
73 |
+
('Tufts Medical Center', 42.3495, -71.0634, 'Teaching hospital', 'Boston'),
|
74 |
+
('Lahey Hospital and Medical Center', 42.5106, -71.2187, 'Community hospital', 'Burlington'),
|
75 |
+
('Baystate Medical Center', 42.1208, -72.6051, 'Teaching hospital', 'Springfield'),
|
76 |
+
('Newton-Wellesley Hospital', 42.3304, -71.2436, 'Community hospital', 'Newton'),
|
77 |
+
('South Shore Hospital', 42.1751, -70.9545, 'Community hospital', 'South Weymouth')
|
78 |
]
|
79 |
|
80 |
# Annotate distances and paths for each medical center
|
81 |
+
st.markdown("## π₯ Massachusetts Medical Centers π")
|
82 |
+
m2 = folium.Map(location=[42.3601, -71.0589], zoom_start=6)
|
83 |
marker_cluster = MarkerCluster().add_to(m2)
|
84 |
+
add_medical_center_paths(m2, source_location, massachusetts_med_centers)
|
85 |
folium_static(m2)
|