fixing markers
This commit is contained in:
@@ -8,23 +8,7 @@ const DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const SHAPES_PATH = resolve(DIR, 'public', 'aircraft.js')
|
||||
|
||||
export async function getShapes() {
|
||||
if (existsSync(SHAPES_PATH)) {
|
||||
return JSON.parse(await readFile(SHAPES_PATH, 'utf8'))
|
||||
}
|
||||
|
||||
const r = await fetch('https://raw.githubusercontent.com/wiedehopf/tar1090/refs/heads/master/html/markers.js', {
|
||||
headers: { 'User-Agent': 'Mozilla/5.0' }
|
||||
})
|
||||
const text = await r.text()
|
||||
|
||||
let shapes = {}
|
||||
eval(text.replace('let shapes', 'shapes') + '; shapes = shapes;')
|
||||
|
||||
const fn = new Function(`${text.replace('let shapes', 'var shapes')}; return shapes;`)
|
||||
shapes = fn()
|
||||
|
||||
await writeFile(SHAPES_PATH, JSON.stringify(shapes))
|
||||
return shapes
|
||||
JSON.parse(await readFile(SHAPES_PATH, 'utf8'))
|
||||
}
|
||||
|
||||
export async function getAirTraffic() {
|
||||
|
||||
Reference in New Issue
Block a user