Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -125,11 +125,17 @@ def create_location_map(df: pd.DataFrame,
|
|
125 |
if not coordinates:
|
126 |
continue
|
127 |
|
|
|
|
|
|
|
|
|
|
|
128 |
# Add individual markers for each location
|
129 |
-
for i,
|
130 |
if coord is not None: # Skip None coordinates
|
131 |
lat, lon = coord
|
132 |
-
|
|
|
133 |
|
134 |
# Create popup content
|
135 |
popup_content = f"<b>{place_name}</b>"
|
|
|
125 |
if not coordinates:
|
126 |
continue
|
127 |
|
128 |
+
# Make sure places and coordinates lists have the same length
|
129 |
+
# If places list is shorter, pad it with unnamed locations
|
130 |
+
while len(places) < len(coordinates):
|
131 |
+
places.append(f"Unnamed Location {len(places)+1}")
|
132 |
+
|
133 |
# Add individual markers for each location
|
134 |
+
for i, coord in enumerate(coordinates):
|
135 |
if coord is not None: # Skip None coordinates
|
136 |
lat, lon = coord
|
137 |
+
# Safely get place name, use a default if index is out of range
|
138 |
+
place_name = places[i].strip() if i < len(places) else f"Location {i+1}"
|
139 |
|
140 |
# Create popup content
|
141 |
popup_content = f"<b>{place_name}</b>"
|