mirror of
https://github.com/CIMEngine/map.git
synced 2024-11-22 02:46:22 +03:00
fix: data non external
This commit is contained in:
parent
de3a212dbb
commit
d6fca4a08e
1 changed files with 5 additions and 9 deletions
14
src/index.js
14
src/index.js
|
@ -31,7 +31,7 @@ window.onload = async () => {
|
||||||
const mapId = params.id || "worldMap";
|
const mapId = params.id || "worldMap";
|
||||||
|
|
||||||
info("Loading", mapId);
|
info("Loading", mapId);
|
||||||
let mIdData = (
|
let mData = (
|
||||||
await (
|
await (
|
||||||
await fetch(
|
await fetch(
|
||||||
`https://raw.githubusercontent.com/CIMEngine/MapList/main/index.json`
|
`https://raw.githubusercontent.com/CIMEngine/MapList/main/index.json`
|
||||||
|
@ -39,17 +39,13 @@ window.onload = async () => {
|
||||||
).json()
|
).json()
|
||||||
)[mapId];
|
)[mapId];
|
||||||
|
|
||||||
if (!mIdData) {
|
if (!mData) {
|
||||||
error(`Map "${mapId}" not found`);
|
error(`Map "${mapId}" not found`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mData = {};
|
if (params.external || mData.external) {
|
||||||
|
info("Getting data from external", params.external || mData.external);
|
||||||
mData.external = params.external || mIdData.external;
|
mData = await (await fetch(params.external || mData.external)).json();
|
||||||
|
|
||||||
if (mData.external) {
|
|
||||||
info("Getting data from external", mData.external);
|
|
||||||
mData = await (await fetch(mData.external)).json();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mData.geoURL = params.geoURL || mData.geoURL;
|
mData.geoURL = params.geoURL || mData.geoURL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue