mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
load map boundary data from remote
This commit is contained in:
parent
f70103367a
commit
63e7ff16fb
3 changed files with 19 additions and 466 deletions
|
|
@ -1,7 +1,18 @@
|
|||
import {mapBoundaries} from './boundaries';
|
||||
let mapBoundaries = {};
|
||||
|
||||
mapBoundaries['koth_viaduct'] = mapBoundaries['koth_product_rc8'];
|
||||
mapBoundaries['cp_prolands'] = mapBoundaries['cp_badlands'];
|
||||
|
||||
export const loadMapData = async () => {
|
||||
if (Object.keys(mapBoundaries).length > 0) {
|
||||
return;
|
||||
}
|
||||
const map_root = document.querySelector('[data-maps]').getAttribute('data-maps');
|
||||
const res = await fetch(`${map_root}boundaries.json`);
|
||||
|
||||
mapBoundaries = await res.json();
|
||||
|
||||
mapBoundaries['koth_viaduct'] = mapBoundaries['koth_product_rc8'];
|
||||
mapBoundaries['cp_prolands'] = mapBoundaries['cp_badlands'];
|
||||
}
|
||||
|
||||
const mapAliases = new Map<string, string>([
|
||||
['cp_prolands', 'cp_badlands']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue