Spaces:
Sleeping
Sleeping
Update services/map_service.py
Browse files- services/map_service.py +0 -2
services/map_service.py
CHANGED
|
@@ -2,14 +2,12 @@ import folium
|
|
| 2 |
import os
|
| 3 |
|
| 4 |
def generate_map(gps_coordinates, cracks):
|
| 5 |
-
# Create a map centered at the average of the GPS coordinates
|
| 6 |
if not gps_coordinates:
|
| 7 |
return None
|
| 8 |
avg_lat = sum(coord[0] for coord in gps_coordinates) / len(gps_coordinates)
|
| 9 |
avg_lon = sum(coord[1] for coord in gps_coordinates) / len(gps_coordinates)
|
| 10 |
m = folium.Map(location=[avg_lat, avg_lon], zoom_start=15)
|
| 11 |
|
| 12 |
-
# Add markers for cracks
|
| 13 |
for coord, crack in zip(gps_coordinates[-len(cracks):], cracks):
|
| 14 |
folium.Marker(
|
| 15 |
location=coord,
|
|
|
|
| 2 |
import os
|
| 3 |
|
| 4 |
def generate_map(gps_coordinates, cracks):
|
|
|
|
| 5 |
if not gps_coordinates:
|
| 6 |
return None
|
| 7 |
avg_lat = sum(coord[0] for coord in gps_coordinates) / len(gps_coordinates)
|
| 8 |
avg_lon = sum(coord[1] for coord in gps_coordinates) / len(gps_coordinates)
|
| 9 |
m = folium.Map(location=[avg_lat, avg_lon], zoom_start=15)
|
| 10 |
|
|
|
|
| 11 |
for coord, crack in zip(gps_coordinates[-len(cracks):], cracks):
|
| 12 |
folium.Marker(
|
| 13 |
location=coord,
|