Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,7 +35,22 @@ m = folium.Map(location=(filtered_data['latitude'].mean(), filtered_data['longit
|
|
| 35 |
|
| 36 |
# Add markers to the map
|
| 37 |
for index, row in filtered_data.iterrows():
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
folium.Marker([row['latitude'], row['longitude']], popup=row['Name'], icon=icon).add_to(m)
|
| 40 |
|
| 41 |
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)]
|
|
|
|
| 35 |
|
| 36 |
# Add markers to the map
|
| 37 |
for index, row in filtered_data.iterrows():
|
| 38 |
+
html_content = f"""
|
| 39 |
+
<div style="
|
| 40 |
+
display: inline-block;
|
| 41 |
+
background-color: white;
|
| 42 |
+
border: 2px solid black;
|
| 43 |
+
border-radius: 50%;
|
| 44 |
+
width: 30px;
|
| 45 |
+
height: 30px;
|
| 46 |
+
text-align: center;
|
| 47 |
+
line-height: 30px;
|
| 48 |
+
font-size: 12pt;
|
| 49 |
+
">{index}</div>
|
| 50 |
+
"""
|
| 51 |
+
|
| 52 |
+
# Create a DivIcon with custom HTML content
|
| 53 |
+
icon = folium.DivIcon(html=html_content)
|
| 54 |
folium.Marker([row['latitude'], row['longitude']], popup=row['Name'], icon=icon).add_to(m)
|
| 55 |
|
| 56 |
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)]
|