Refactor coordinate processing into Polygons class

We have a bunch of stuff for doing lat/long transformation in the
`BroadcastMessage` class. This is not a good separation of concerns, now
that we have a separate class for dealing with polygons and coordinates.
This commit is contained in:
Chris Hill-Scott
2020-08-25 16:55:09 +01:00
parent c49a6338af
commit 3d9d663b27
7 changed files with 52 additions and 83 deletions

View File

@@ -36,7 +36,7 @@
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
{% for polygon in broadcast_message.simple_polygons.bleed.as_coordinate_pairs %}
{% for polygon in broadcast_message.simple_polygons.bleed.as_coordinate_pairs_lat_long %}
polygons.push(
L.polygon({{polygon}}, {
opacity: 0.5,
@@ -48,7 +48,7 @@
);
{% endfor %}
{% for polygon in broadcast_message.simple_polygons.as_coordinate_pairs %}
{% for polygon in broadcast_message.simple_polygons.as_coordinate_pairs_lat_long %}
polygons.push(
L.polygon({{polygon}}, {
opacity: 0.1,
@@ -60,7 +60,7 @@
);
{% endfor %}
{% for polygon in broadcast_message.polygons.as_coordinate_pairs %}
{% for polygon in broadcast_message.polygons.as_coordinate_pairs_lat_long %}
polygons.push(
L.polygon({{polygon}}, {
color: '#0b0b0c', // $black