Merge pull request #3590 from alphagov/buffer-de-buffer

Make simplification of polygons more sophisticated
This commit is contained in:
Chris Hill-Scott
2020-08-28 10:15:49 +01:00
committed by GitHub
9 changed files with 314 additions and 209 deletions

View File

@@ -36,19 +36,31 @@
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
{% for polygon in broadcast_message.simple_polygons %}
{% for polygon in broadcast_message.simple_polygons.bleed.as_coordinate_pairs_lat_long %}
polygons.push(
L.polygon({{polygon}}, {
opacity: 0.5,
color: '#2B8CC4', // $light-blue
opacity: 0.4,
fillColor: '#2B8CC4', // $light-blue
fillOpacity: 0.3,
fillOpacity: 0.2,
weight: 2
})
);
{% endfor %}
{% for polygon in broadcast_message.simple_polygons.as_coordinate_pairs_lat_long %}
polygons.push(
L.polygon({{polygon}}, {
opacity: 0.1,
color: '#2B8CC4', // $black
fillColor: '#2B8CC4', // $light-blue
fillOpacity: 0.4,
weight: 1
})
);
{% endfor %}
{% for polygon in broadcast_message.polygons %}
{% for polygon in broadcast_message.polygons.as_coordinate_pairs_lat_long %}
polygons.push(
L.polygon({{polygon}}, {
color: '#0b0b0c', // $black
@@ -61,7 +73,7 @@
var polygonGroup = L.featureGroup(polygons).addTo(mymap);
mymap.fitBounds(
polygonGroup.getBounds(),
{padding: [5, 5]}
{padding: [1, 1]}
);
</script>