Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SimStadt
3DClient4SimStadtAPI
Commits
3e5f48b6
Commit
3e5f48b6
authored
Jan 18, 2022
by
Boehmer
Browse files
change method
parent
4d77ad0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/js/connectToAPI.js
View file @
3e5f48b6
...
...
@@ -424,26 +424,26 @@ function timeout(ms, promise) {
function
pageLoad
()
{
if
(
window
.
location
.
hash
===
"
#load-bau1
"
)
{
loadAndZoomTo
Tileset
(
tilesetURLb1
);
fetch
Tileset
(
tilesetURLb1
);
}
if
(
window
.
location
.
hash
===
"
#load-bau2
"
)
{
loadAndZoomTo
Tileset
(
tilesetURLb2
);
}
if
(
window
.
location
.
hash
===
"
#load-bau4
"
)
{
loadAndZoomTo
Tileset
(
tilesetURLb4
);
}
if
(
window
.
location
.
hash
===
"
#load-bau5
"
)
{
loadAndZoomTo
Tileset
(
tilesetURLb5
);
}
if
(
window
.
location
.
hash
===
"
#load-bau6
"
)
{
loadAndZoomTo
Tileset
(
tilesetURLb6
);
}
if
(
window
.
location
.
hash
===
"
#load-bau7
"
)
{
loadAndZoomTo
Tileset
(
tilesetURLb7
);
}
if
(
window
.
location
.
hash
===
"
#load-bau8
"
)
{
loadAndZoomTo
Tileset
(
tilesetURLb8
);
}
fetch
Tileset
(
tilesetURLb2
);
}
if
(
window
.
location
.
hash
===
"
#load-bau4
"
)
{
fetch
Tileset
(
tilesetURLb4
);
}
if
(
window
.
location
.
hash
===
"
#load-bau5
"
)
{
fetch
Tileset
(
tilesetURLb5
);
}
if
(
window
.
location
.
hash
===
"
#load-bau6
"
)
{
fetch
Tileset
(
tilesetURLb6
);
}
if
(
window
.
location
.
hash
===
"
#load-bau7
"
)
{
fetch
Tileset
(
tilesetURLb7
);
}
if
(
window
.
location
.
hash
===
"
#load-bau8
"
)
{
fetch
Tileset
(
tilesetURLb8
);
}
}
//fetching the tileset and handling the connection
async
function
fetchTileset
(){
timeout
(
1000
,
fetch
(
tileset
URL
)).
then
((
response
)
=>
{
loadAndZoomToTileset
(
tileset
URL
);
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
"
}
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment