Commit e3030f47 authored by Kolokolnikova's avatar Kolokolnikova
Browse files

-fixed bug in localshadowdata and localbuildinginformation

parent b045e623
......@@ -122,24 +122,23 @@ async function fetchDataJSON() {
document.getElementById("loader").style.visibility = "hidden"
async function getLocalShadowdata() {
// gets the response from the api and put it inside a constant
// gets the response from localShadowData and put it inside a constant
const response = await fetch(localShadowData);
//the response have to be converted to json type file, so it can be used
const data = await response.json();
console.log(data)
// shadowData=data;
return data;
}
function processData() {
async function processData() {
console.log(coordinatesBB)
console.log("Waiting for data....")
shadowdata= await getLocalShadowdata()
timeout(25000, fetchshadowDataJSON()).then((response) => {
timeout(25000, getLocalShadowdata()).then((response) => {
console.log(response)
shadowdata = response;
}).catch((error) => { //catching the error(no connection)/ timeout and displaying an alert for the user
// shadowdata= getLocalShadowdata();
console.log(shadowdata);
//loadLocalAPIshadowData here...
})
......@@ -155,11 +154,11 @@ function processData() {
calculateData(response);
}).catch((error) => {
console.log(error)
/*
fetch("/3dclient4simstadtapi/public/test/APIdata/buildingInformation.json")
.then(response => response.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