Fixed marker url
This commit is contained in:
@@ -5,7 +5,7 @@ import { resolve, dirname } from 'path'
|
||||
import { fileURLToPath } from '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() {
|
||||
if (existsSync(SHAPES_PATH)) {
|
||||
@@ -18,7 +18,7 @@ export async function getShapes() {
|
||||
// tar1090 exposes a var with all the shape definitions
|
||||
let shapes = {}
|
||||
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])
|
||||
} catch (e) {
|
||||
console.error('Failed to parse tar1090 shapes:', e)
|
||||
|
||||
Reference in New Issue
Block a user