Hooked up auroras

This commit is contained in:
2026-09-11 22:08:14 -04:00
parent fc306f277a
commit 6bcc5bec19
6 changed files with 132 additions and 16 deletions

View File

@@ -219,7 +219,7 @@ const navball = computed(() => {
<!-- Photo -->
<div v-if="!photoError" class="ap-photo-wrap">
<img class="ap-photo" :src="BASE + '/api/adsb-image/' + plane.icao" :alt="callsign" @error="photoError = true" />
<img class="ap-photo" :src="BASE + '/api/adsb/' + plane.icao + '/image'" :alt="callsign" @error="photoError = true" />
</div>
<!-- Body -->

View File

@@ -19,6 +19,7 @@ import { defaults as defaultInteractions } from 'ol/interaction'
import { fromLonLat, toLonLat } from 'ol/proj'
import { Style, Fill, Stroke, Circle as CircleStyle } from 'ol/style'
import { applyStyle } from 'ol-mapbox-style'
import { Aurora } from '@/services/aurora.ts'
import 'ol/ol.css'
const current = ref({ latitude: 0, longitude: 0 })
@@ -35,6 +36,7 @@ const OVERLAYS = [
{ id: 'traffic', label: 'Traffic', icon: '✈️' },
{ id: 'sats', label: 'Sats', icon: '🛰️' },
{ id: 'rain', label: 'Rain', icon: '🌧️' },
{ id: 'aurora', label: 'Aurora', icon: '🌌' },
{ id: 'wind', label: 'Wind', icon: '💨' },
]
@@ -48,6 +50,7 @@ let airTraffic: AirTrafficLayer
let aisLayer: AISLayer
let range: RangeLayer
let sats: SatsLayer
let aurora: Aurora
function buildWindSrc(lat: number, lon: number, zoom: number) {
return `https://embed.windy.com/embed2.html?lat=${lat.toFixed(4)}&lon=${lon.toFixed(4)}&detailLat=${lat.toFixed(4)}&detailLon=${lon.toFixed(4)}&zoom=${Math.round(zoom)}&level=surface&overlay=wind&product=ecmwf&menu=&message=&marker=&calendar=now&pressure=&type=map&location=coordinates&detail=&metricWind=kt&metricTemp=%C2%B0C&radarRange=-1`
@@ -124,6 +127,14 @@ function toggleOverlay(id: string) {
airTraffic.show()
range.show()
}
} else if (id === 'aurora') {
if (activeOverlays.value.has('aurora')) {
activeOverlays.value.delete('aurora')
aurora.hide()
} else {
activeOverlays.value.add('aurora')
aurora.show()
}
} else if (id === 'sats') {
if (activeOverlays.value.has('sats')) {
activeOverlays.value.delete('sats')
@@ -207,6 +218,7 @@ onMounted(async () => {
airTraffic.show()
sats = new SatsLayer(map)
sats.show();
aurora = new Aurora(map)
range = new RangeLayer(map)
range.show()

View File

@@ -213,7 +213,7 @@ const compass = computed(() => {
<!-- Photo -->
<div v-if="!photoError" class="sp-photo-wrap">
<img class="sp-photo" :src="BASE + '/api/ais-iamge/' + boat.mmsi" :alt="name" @error="photoError = true" />
<img class="sp-photo" :src="BASE + '/api/ais/' + boat.mmsi + '/image'" :alt="name" @error="photoError = true" />
</div>
<div class="sp-body">