Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,12 +52,13 @@ for index, row in filtered_data.iterrows():
|
|
| 52 |
text-align: center;
|
| 53 |
line-height: 20px;
|
| 54 |
font-size: 8pt;
|
|
|
|
| 55 |
">{index}</div>
|
| 56 |
"""
|
| 57 |
|
| 58 |
# Create a DivIcon with custom HTML content
|
| 59 |
icon = folium.DivIcon(html=html_content)
|
| 60 |
-
folium.Marker([row['latitude'], row['longitude']], popup=row['Name'], icon=icon)
|
| 61 |
|
| 62 |
#add to groups
|
| 63 |
marker.add_to(all_markers)
|
|
@@ -66,6 +67,16 @@ for index, row in filtered_data.iterrows():
|
|
| 66 |
else:
|
| 67 |
marker.add_to(inactive_markers)
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
polygon_coords = [ [np.random.uniform(40.7, 40.8, size=6)[i], np.random.uniform(-74.0, -73.9, size=6)[i]] for i in range(6)]
|
| 70 |
|
| 71 |
# Create a polygon object
|
|
|
|
| 52 |
text-align: center;
|
| 53 |
line-height: 20px;
|
| 54 |
font-size: 8pt;
|
| 55 |
+
color: {status_color};
|
| 56 |
">{index}</div>
|
| 57 |
"""
|
| 58 |
|
| 59 |
# Create a DivIcon with custom HTML content
|
| 60 |
icon = folium.DivIcon(html=html_content)
|
| 61 |
+
folium.Marker([row['latitude'], row['longitude']], popup=row['Name'], icon=icon)#.add_to(m)
|
| 62 |
|
| 63 |
#add to groups
|
| 64 |
marker.add_to(all_markers)
|
|
|
|
| 67 |
else:
|
| 68 |
marker.add_to(inactive_markers)
|
| 69 |
|
| 70 |
+
|
| 71 |
+
# Add layers to the map
|
| 72 |
+
all_markers.add_to(m)
|
| 73 |
+
active_markers.add_to(m)
|
| 74 |
+
inactive_markers.add_to(m)
|
| 75 |
+
|
| 76 |
+
# Add layer control to toggle marker visibility
|
| 77 |
+
folium.LayerControl().add_to(m)
|
| 78 |
+
|
| 79 |
+
|
| 80 |
polygon_coords = [ [np.random.uniform(40.7, 40.8, size=6)[i], np.random.uniform(-74.0, -73.9, size=6)[i]] for i in range(6)]
|
| 81 |
|
| 82 |
# Create a polygon object
|