Fixed marker url

This commit is contained in:
2026-06-22 00:13:46 -04:00
parent a80516d864
commit 0e49efdb34

View File

@@ -5,7 +5,7 @@ import { resolve, dirname } from 'path'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
const DIR = dirname(fileURLToPath(import.meta.url)) const DIR = dirname(fileURLToPath(import.meta.url))
const SHAPES_PATH = resolve(DIR, 'shapes.json') const SHAPES_PATH = resolve(DIR, 'public', 'aircraft.js')
export async function getShapes() { export async function getShapes() {
if (existsSync(SHAPES_PATH)) { if (existsSync(SHAPES_PATH)) {
@@ -18,7 +18,7 @@ export async function getShapes() {
// tar1090 exposes a var with all the shape definitions // tar1090 exposes a var with all the shape definitions
let shapes = {} let shapes = {}
try { try {
const match = text.match(/var\s+_aircraft_markers\s*=\s*(\{[\s\S]*?\});/) const match = text.match(/let\s+shapes\s*=\s*(\{[\s\S]*?\n\})/);
if (match) shapes = JSON.parse(match[1]) if (match) shapes = JSON.parse(match[1])
} catch (e) { } catch (e) {
console.error('Failed to parse tar1090 shapes:', e) console.error('Failed to parse tar1090 shapes:', e)