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

change method

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