ADSB images

This commit is contained in:
2026-07-04 22:04:12 -04:00
parent 0a722edcc6
commit 54c53a5822
2 changed files with 12 additions and 8 deletions

View File

@@ -241,7 +241,7 @@ const navball = computed(() => {
<!-- Photo --> <!-- Photo -->
<div v-if="photoUrl" class="ap-photo-wrap"> <div v-if="photoUrl" class="ap-photo-wrap">
<img class="ap-photo" :class="{ 'ap-photo--sil': isSil }" :src="photoUrl" :alt="callsign" /> <img class="ap-photo" :class="{ 'ap-photo--sil': isSil }" :src="'/api/adsb-image/' + plane.icao" :alt="callsign" />
</div> </div>
<!-- Body --> <!-- Body -->

View File

@@ -3,6 +3,8 @@ import { AirTrafficLayer } from '@/services/adsb.ts'
import { AISLayer } from '@/services/ais.ts' import { AISLayer } from '@/services/ais.ts'
import {api} from '@/services/api.ts'; import {api} from '@/services/api.ts';
import {RangeLayer} from '@/services/range.ts'; import {RangeLayer} from '@/services/range.ts';
import VectorTileLayer from 'ol/layer/VectorTile';
import VectorTileSource from 'ol/source/VectorTile';
import { computed, onMounted, onUnmounted, ref, watch } from 'vue' import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import Map from 'ol/Map' import Map from 'ol/Map'
import View from 'ol/View' import View from 'ol/View'
@@ -128,12 +130,13 @@ function toggleOverlay(id: string) {
} }
function buildBaseLayer(dark: boolean) { function buildBaseLayer(dark: boolean) {
return new TileLayer({ return new VectorTileLayer({
source: new XYZ({ source: new VectorTileSource({
url: dark url: dark
? 'https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}.png' ? 'https://tiles.zakscode.com/data/osm/{z}/{x}/{y}.pbf'
: 'https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}.png', : 'https://tiles.zakscode.com/styles/light/512/{z}/{x}/{y}.png',
attributions: '© Stadia Maps © OpenMapTiles © OpenStreetMap', // ? 'https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}.png'
// : 'https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}.png',
}), }),
}) })
} }
@@ -175,8 +178,9 @@ function buildStationLayer(lat: number, lon: number, dark: boolean): VectorLayer
} }
onMounted(async () => { onMounted(async () => {
await fetchRadarFrames() fetchRadarFrames().then(() => {
radarFrameIndex.value = nowcastStartIndex.value - 1 radarFrameIndex.value = nowcastStartIndex.value - 1
});
const position = await api.position(); const position = await api.position();