Commit 72aad392 authored by Muharemi's avatar Muharemi
Browse files

added descriptions to TODOs

parent b1a534a8
var coordinatesBB = [] var coordinatesBB = []
//var url = "https://simstadt-api.iaf-ex.hft-stuttgart.de:8080/workflow/execute" //old link //var url = "https://simstadt-api.iaf-ex.hft-stuttgart.de:8080/workflow/execute" //old link
var url = "http://vm24.fkc.hft-stuttgart.de:8080/workflow/execute" var url = "http://vm24.fkc.hft-stuttgart.de:8080/workflow/execute" // URL to API
var buildingFunctionSort var buildingFunctionSort
...@@ -55,8 +55,8 @@ async function fetchDataJSON() { ...@@ -55,8 +55,8 @@ async function fetchDataJSON() {
} }
document.getElementById("loader").style.visibility = "hidden" document.getElementById("loader").style.visibility = "hidden"
/*TODO: -use local test data /*TODO#1: -get current data from the api and create local test data (apiData foler)
-no connection handeling -add connection handeling (error messages when there isnt a connection and then using the local test data)
*/ */
function processData() { function processData() {
console.log(coordinatesBB) console.log(coordinatesBB)
...@@ -289,15 +289,16 @@ window.onclick = function (event) { ...@@ -289,15 +289,16 @@ window.onclick = function (event) {
} }
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
var tileData = null var tileData = null;
var tileset = null var tileset = null;
var tilesetURL = 'http://vm24.fkc.hft-stuttgart.de:8081/CampusLOD2/CityModel/tileset.json'; var tilesetURL = 'http://vm24.fkc.hft-stuttgart.de:8081/CampusLOD2/CityModel/tileset.json';
var localTestTileset = '/3dclient4simstadtapi/public/test/tileset/gmlTileset_v1.json'; var localTestTileset = '/3dclient4simstadtapi/public/test/tileset/gmlTileset_v1.json';
//fetching the tileset and handling the connection //fetching the tileset and handling the connection
// TODO: cancel timemout when there isnt a connection // TODO#2: add a timemout when there isnt a connection (1sec) -> so the user doesnt have to wait 10sec for the failed fetch
async function fetchTileset(){ async function fetchTileset(){
fetch(tilesetURL).then((response)=>{ fetch(tilesetURL).then((response)=>{
if(response.status >= 200 && response.status<=299){ //successful connection if(response.status >= 200 && response.status<=299){ //successful connection
//const tilesetJSON = response.json(); //const tilesetJSON = response.json();
...@@ -313,32 +314,35 @@ async function fetchTileset(){ ...@@ -313,32 +314,35 @@ async function fetchTileset(){
swal("Could not connect to Server",errorString , "error"); swal("Could not connect to Server",errorString , "error");
console.log("Using local test data"); console.log("Using local test data");
loadAndZoomTime(localTestTileset); //TODO: fix loading local data loadAndZoomTime(localTestTileset); //TODO#3: fix the link so the local tileset can be loaded
}); })
//swal({text:"Connecting to Server ... Please wait !",icon:"info" ,buttons: false}); //displays waiting alert
swal({text:"Connecting to Server ... Please wait !",icon:"info" ,buttons: false}); //displays waiting alert
} }
//loads tileset after submit button is clicked //loads tileset after submit button is clicked
/* /*
FIXME: -load the models but the are in the too high in the "air" NOTE #1: -load the models but the are in the too high in the "air"
-building view doesn´t work because all buildings are grouped together -building view doesn´t work because all buildings are grouped together
-surfaces are also broken -surfaces are also broken
-->this fixme is the problem of the backendteam !
? maybe add old menu back and the option to also load the new ones ? maybe add old menu back and the option to also load the new ones
*/ */
function loadTileset() { function loadTileset() {
viewer.scene.primitives.remove(tileset) viewer.scene.primitives.remove(tileset);
tileContent = [] tileContent = [];
modal.style.display = "block"; modal.style.display = "block";
fetchTileset(); fetchTileset();
//var userurl = document.getElementById("3Durl").value; //returns the chosen area from the dropdown //var userurl = document.getElementById("3Durl").value; //returns the chosen area from the dropdown
} }
//loads the tileset from the url into the cesium viewer and zooms to it
function loadAndZoomTime(url){ function loadAndZoomTime(url){
tileset=viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ tileset=viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: url url: url
......
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