diff --git a/src/CrowTypes.ts b/src/CrowTypes.ts index 4c38388..74c570c 100644 --- a/src/CrowTypes.ts +++ b/src/CrowTypes.ts @@ -54,6 +54,7 @@ export interface RadarInterface { endpoint: string; // URL template, some variables are interpolated. Example: 'https://opendata.meteo.be/ftp/observations/radar/vbird/{odimCode}/{yyyy}/{odimCode}_vpts_{yyyymmdd}.txt' vptsFileFormat: VPTSFileFormat; heights: number[]; // Data is available at the following heights + showOnMap?: boolean; // If false, the radar will not be displayed on the map } export type VPTSFileFormat = "VOL2BIRD" | "CSV"; // VOL2BIRD: fixed width column. CSV: Follow BioRad's output (see https://github.com/inbo/crow/issues/135) diff --git a/src/components/SiteSelectorMap.vue b/src/components/SiteSelectorMap.vue index e39297b..8f33c3d 100644 --- a/src/components/SiteSelectorMap.vue +++ b/src/components/SiteSelectorMap.vue @@ -2,7 +2,7 @@ - + {{ radar.displayLabel }} @@ -44,7 +44,7 @@ export default Vue.extend({ radarsFeatures: function (): d3.ExtendedFeatureCollection { let geojson = { type: "FeatureCollection", features: [] } as d3.ExtendedFeatureCollection - this.radars.forEach(r => { + this.visibleRadars.forEach(r => { let feature = { "type": "Feature", "geometry": { @@ -59,14 +59,15 @@ export default Vue.extend({ return geojson }, - radars: function (): RadarInterface[] { + visibleRadars: function (): RadarInterface[] { // Flat array of radars based on the "sites" prop let r: RadarInterface[] = [] this.sites.forEach(e => { r = r.concat(e.options) }) - return r; + // Filter out radars that have a shownOnMap property set to false + return r.filter(r => r.showOnMap !== false); }, projection: function (): d3.GeoProjection { return d3.geoMercator() diff --git a/src/config.ts b/src/config.ts index ecedd1a..b6903c7 100644 --- a/src/config.ts +++ b/src/config.ts @@ -27,7 +27,7 @@ export default { { odimCode: "behel", text: "Helchteren", latitude: 51.069199, longitude: 5.406138, timezone: "Europe/Brussels", endpoint: meteoBeUrlTemplate, heights: availableHeights, vptsFileFormat: 'VOL2BIRD' }, { odimCode: "bejab", text: "Jabbeke", latitude: 51.1919, longitude: 3.0641, timezone: "Europe/Brussels", endpoint: meteoBeUrlTemplate, heights: availableHeights, vptsFileFormat: 'VOL2BIRD' }, { odimCode: "bewid", text: "Wideumont", latitude: 49.9135, longitude: 5.5044, timezone: "Europe/Brussels", endpoint: meteoBeUrlTemplate, heights: availableHeights, vptsFileFormat: 'VOL2BIRD' }, - { odimCode: "bezav", text: "Zaventem", latitude: 50.9054, longitude: 4.4579, timezone: "Europe/Brussels", endpoint: meteoBeUrlTemplate, heights: availableHeights, vptsFileFormat: 'VOL2BIRD' }, + { odimCode: "bezav", text: "Zaventem", latitude: 50.9054, longitude: 4.4579, timezone: "Europe/Brussels", endpoint: meteoBeUrlTemplate, heights: availableHeights, vptsFileFormat: 'VOL2BIRD', showOnMap: true }, ] }, {