diff --git a/client/src/components/MapView.vue b/client/src/components/MapView.vue index 16b1992..473cec1 100644 --- a/client/src/components/MapView.vue +++ b/client/src/components/MapView.vue @@ -32,11 +32,13 @@ const showWind = ref(false) const windSrc = ref('') const OVERLAYS = [ + { id: 'traffic', label: 'Traffic', icon: '✈️' }, + { id: 'sats', label: 'Sats', icon: '🛰️' }, { id: 'rain', label: 'Rain', icon: '🌧️' }, { id: 'wind', label: 'Wind', icon: '💨' }, ] -const activeOverlays = ref>(new Set(['rain'])) +const activeOverlays = ref>(new Set(['traffic', 'rain'])) const overlayLayers: { [key: string]: any } = {} let map: Map @@ -108,20 +110,21 @@ async function refreshRain() { map.addLayer(layer) } -function toggleAT() { - if (atActive.value) { - aisLayer.hide() - airTraffic.hide() - range.hide() - } else { - aisLayer.show() - airTraffic.show() - range.show() - } - atActive.value = !atActive.value -} - function toggleOverlay(id: string) { + if (id === 'traffic') { + if (activeOverlays.value.has('traffic')) { + activeOverlays.value.delete('traffic'); + aisLayer.hide() + airTraffic.hide() + range.hide() + } else { + activeOverlays.value.add('traffic'); + aisLayer.show() + airTraffic.show() + range.show() + } + } + if (id === 'wind') { if (activeOverlays.value.has('wind')) { activeOverlays.value.delete('wind') @@ -340,9 +343,6 @@ watch(() => props.dark, dark => { />
-
-