Commit 3e5f48b6 authored by Boehmer's avatar Boehmer
Browse files

change method

parent 4d77ad0a
......@@ -424,26 +424,26 @@ function timeout(ms, promise) {
function pageLoad() {
if (window.location.hash === "#load-bau1") {
loadAndZoomToTileset(tilesetURLb1);
fetchTileset(tilesetURLb1);
}if (window.location.hash === "#load-bau2") {
loadAndZoomToTileset(tilesetURLb2);
}if (window.location.hash === "#load-bau4") {
loadAndZoomToTileset(tilesetURLb4);
}if (window.location.hash === "#load-bau5") {
loadAndZoomToTileset(tilesetURLb5);
}if (window.location.hash === "#load-bau6") {
loadAndZoomToTileset(tilesetURLb6);
}if (window.location.hash === "#load-bau7") {
loadAndZoomToTileset(tilesetURLb7);
}if (window.location.hash === "#load-bau8") {
loadAndZoomToTileset(tilesetURLb8);
}
fetchTileset(tilesetURLb2);
}if (window.location.hash === "#load-bau4") {
fetchTileset(tilesetURLb4);
}if (window.location.hash === "#load-bau5") {
fetchTileset(tilesetURLb5);
}if (window.location.hash === "#load-bau6") {
fetchTileset(tilesetURLb6);
}if (window.location.hash === "#load-bau7") {
fetchTileset(tilesetURLb7);
}if (window.location.hash === "#load-bau8") {
fetchTileset(tilesetURLb8);
}
}
//fetching the tileset and handling the connection
async function fetchTileset(){
timeout(1000, fetch(tilesetURL)).then((response)=>{
loadAndZoomToTileset(tilesetURL);
async function fetchTileset(tileset){
timeout(1000, fetch(tileset)).then((response)=>{
loadAndZoomToTileset(tileset);
}).catch((error)=>{ //catching the error(no connection)/ timeout and displaying an alert for the user
//var errorString = error["stack"]+"\n"+error["message"]; // formatting the error array
swal({text:"Could not connect to Server. Using now: local data",icon:"info" } );
......
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