Skip to content

Commit 6046711

Browse files
authored
Add support for areas.json geojson hidden property (#364)
* Add support for areas.json geojson hidden property * Add hidden property to areas.example.json * Fix lint
1 parent 20c6042 commit 6046711

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

static/custom/areas.example.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"fill-opacity": 0.5,
2222
"stroke": "#352BFF",
2323
"stroke-width": 2.0,
24-
"fill": "#0651FF"
24+
"fill": "#0651FF",
25+
"hidden": false
2526
}
2627
}
2728
]

static/js/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,10 +2671,12 @@ function loadScanAreaPolygons () {
26712671
try {
26722672
let areaGeoPolys = L.geoJson(scanAreasDb, {
26732673
onEachFeature: function(features, featureLayer) {
2674-
let coords = features.geometry.coordinates[0];
2675-
let areaSize = geodesicArea(coords);
2676-
let size = convertAreaToSqkm(areaSize).toFixed(2);
2677-
featureLayer.bindPopup(getScanAreaPopupContent(features.properties.name, size));
2674+
if (!features.properties.hidden) {
2675+
const coords = features.geometry.coordinates[0];
2676+
const areaSize = geodesicArea(coords);
2677+
const size = convertAreaToSqkm(areaSize).toFixed(2);
2678+
featureLayer.bindPopup(getScanAreaPopupContent(features.properties.name, size));
2679+
}
26782680
}
26792681
});
26802682
scanAreaLayer.addLayer(areaGeoPolys);

0 commit comments

Comments
 (0)