Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
c72f674
1
Parent(s):
18e86d5
use asterisk for multiple requests
Browse files
app.py
CHANGED
@@ -97,14 +97,14 @@ def show_requests(filtered_df):
|
|
97 |
"""Display victim requests on the map"""
|
98 |
for index, row in filtered_df.iterrows():
|
99 |
request_type = row["ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)"]
|
100 |
-
displayed_request = marker_request(request_type)
|
101 |
long_lat = row[
|
102 |
"هل يمكنك تقديم الإحداثيات الدقيقة للموقع؟ (ادا كنت لا توجد بعين المكان) متلاً \n31.01837503440344, -6.781405948842175"
|
103 |
]
|
104 |
maps_url = f"https://maps.google.com/?q={long_lat}"
|
105 |
# we display all requests in popup text and use the first one for the icon/color
|
106 |
display_text = f'<b>Request Type:</b> {request_type}<br><b>Id:</b> {row["id"]}<br><a href="{maps_url}" target="_blank" rel="noopener noreferrer"><b>Google Maps</b></a>'
|
107 |
-
icon_name = ICON_MAPPING.get(
|
108 |
if row["latlng"] is None:
|
109 |
continue
|
110 |
|
@@ -115,7 +115,7 @@ def show_requests(filtered_df):
|
|
115 |
else None,
|
116 |
popup=folium.Popup(display_text, max_width=300),
|
117 |
icon=folium.Icon(
|
118 |
-
color=COLOR_MAPPING.get(displayed_request, "blue"), icon=icon_name
|
119 |
),
|
120 |
))
|
121 |
|
|
|
97 |
"""Display victim requests on the map"""
|
98 |
for index, row in filtered_df.iterrows():
|
99 |
request_type = row["ما هي احتياجاتك؟ (أضفها إذا لم يتم ذكرها)"]
|
100 |
+
displayed_request = marker_request(request_type) # TODO: the marker should depend on selected_options
|
101 |
long_lat = row[
|
102 |
"هل يمكنك تقديم الإحداثيات الدقيقة للموقع؟ (ادا كنت لا توجد بعين المكان) متلاً \n31.01837503440344, -6.781405948842175"
|
103 |
]
|
104 |
maps_url = f"https://maps.google.com/?q={long_lat}"
|
105 |
# we display all requests in popup text and use the first one for the icon/color
|
106 |
display_text = f'<b>Request Type:</b> {request_type}<br><b>Id:</b> {row["id"]}<br><a href="{maps_url}" target="_blank" rel="noopener noreferrer"><b>Google Maps</b></a>'
|
107 |
+
icon_name = ICON_MAPPING.get(request_type, "asterisk")
|
108 |
if row["latlng"] is None:
|
109 |
continue
|
110 |
|
|
|
115 |
else None,
|
116 |
popup=folium.Popup(display_text, max_width=300),
|
117 |
icon=folium.Icon(
|
118 |
+
color=COLOR_MAPPING.get(displayed_request, "blue"), icon=icon_name, prefix="glyphicon"
|
119 |
),
|
120 |
))
|
121 |
|