mirror of
https://github.com/CIMEngine/map.git
synced 2024-11-22 02:46:22 +03:00
refactor: external parsing
This commit is contained in:
parent
fc6b758d4c
commit
ffce6aeb51
1 changed files with 3 additions and 7 deletions
10
src/index.js
10
src/index.js
|
@ -42,20 +42,16 @@ window.onload = async () => {
|
||||||
).json()
|
).json()
|
||||||
)[mapId];
|
)[mapId];
|
||||||
|
|
||||||
if (mIdData.external) {
|
|
||||||
mIdData = await (await fetch(mIdData.external)).json();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mIdData) {
|
if (!mIdData) {
|
||||||
alert(`Map ${mapId} not found`);
|
alert(`Map ${mapId} not found`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mData = {};
|
let mData = {};
|
||||||
|
|
||||||
if (params.external) {
|
mData.external = params.external || mIdData.external;
|
||||||
const data = await (await fetch(params.external)).json();
|
|
||||||
|
|
||||||
mData.geoURL = data.geoURL;
|
if (mData.external) {
|
||||||
|
mData = await (await fetch(mData.external)).json();
|
||||||
}
|
}
|
||||||
|
|
||||||
mData.geoURL = params.geoURL || mIdData.geoURL;
|
mData.geoURL = params.geoURL || mIdData.geoURL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue