Commit fb79964a authored by Kolokolnikova's avatar Kolokolnikova
Browse files

-updated api data(buildinginformationdata)

-timeout for local api data load added
parent 0258c397
...@@ -103,16 +103,15 @@ function processData() { ...@@ -103,16 +103,15 @@ function processData() {
shadowdata = response ; shadowdata = response ;
}).catch((error)=>{ //catching the error(no connection)/ timeout and displaying an alert for the user }).catch((error)=>{ //catching the error(no connection)/ timeout and displaying an alert for the user
swal({text:"Could not connect to Server. Using now: local data",icon:"info" } );
console.log("Using local test data"); console.log("Using local test data");
//loadLocalAPIshadowData here... //loadLocalAPIshadowData here...
}) })
fetchDataJSON().then(data => { timeout(1000, fetchDataJSON()).then((response)=>{
calculateData(data); calculateData(response);
}).catch(() => { }).catch((error) => {
console.log("wird nix") console.log(error)
fetch("/3dclient4simstadtapi/public/test/APIdata/buildingInformation.json") fetch("/3dclient4simstadtapi/public/test/APIdata/buildingInformation.json")
.then(response => response.text()) .then(response => response.text())
.then(text => calculateData( JSON.parse(text))) .then(text => calculateData( JSON.parse(text)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment