diff --git a/monocle/web_utils.py b/monocle/web_utils.py index 684b548d2..f97cfcbf9 100644 --- a/monocle/web_utils.py +++ b/monocle/web_utils.py @@ -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: