mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix handling of empty polys in the new UI.
This was copied from the Qt map and tweaked, but the use cases are slightly different so this needs to return an empty list for an empty polygon instead of None. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1121
This commit is contained in:
parent
de9651533f
commit
81ce7fbb62
@ -52,9 +52,9 @@ LeafletLatLon = List[float]
|
||||
|
||||
def shapely_poly_to_leaflet_points(
|
||||
poly: Polygon, theater: ConflictTheater
|
||||
) -> Optional[List[LeafletLatLon]]:
|
||||
) -> List[LeafletLatLon]:
|
||||
if poly.is_empty:
|
||||
return None
|
||||
return []
|
||||
return [theater.point_to_ll(Point(x, y)).as_list() for x, y in poly.exterior.coords]
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user