Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions monocle/web_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,24 @@ def get_spawnpoint_markers():
} for spawn in spawns]

if conf.BOUNDARIES:
from shapely.geometry import mapping
from shapely.geometry import mapping, Polygon

def get_scan_coords():
coordinates = mapping(conf.BOUNDARIES)['coordinates']
coords = coordinates[0]
markers = [{
'type': 'scanarea',
'coords': coords
}]
for blacklist in coordinates[1:]:
markers = []
boundaries = conf.BOUNDARIES
if isinstance(boundaries, Polygon):
boundaries = [boundaries]
for boundary in boundaries:
coordinates = mapping(boundary)['coordinates']
coords = coordinates[0]
for blacklist in coordinates[1:]:
markers.append({
'type': 'scanblacklist',
'coords': blacklist
})
markers.append({
'type': 'scanblacklist',
'coords': blacklist
'type': 'scanarea',
'coords': coords
})
return markers
else:
Expand Down