var internStuff = { attic: true, atticHeating: true, basement: true, basementHeating: true, buildingType: "EFH", // other options: "RH", "MFH", "GFH", "HH" flatRoof: true, id: 'DEBW522AA000039fd', // equal with glmid latitude: 51.44679140365339, // an example of a building in Essen longitude: 6.967781962878631, // an example of a building in Essen refurbishment: "statuQuo", // other options: "medium", "advanced" simulationName: "MonthlyEnergyBalance", // just use this value for Heat/Cooling Demand storeyCount: 3, timestep: 1, // dummy integer, not yet integrated but mandatory usageProfile: "Single Family House", // // other options: "Multi Family House" yearOfConstruction: 1946 } // var SimSInput = { // gmlid: 'DENW22AL700004Lv', // an example of a building in Essen DENW22AL700004Lv // cityID: 3, //, Essen 3 // Stockach 1 // // ui: internStuff // }; var SimSOutput = "" //Test SimStadt API //DEBW522AA0001585e var callSimS = function(){ var framework = vcs.vcm.Framework.getInstance(); var layers = framework.getLayers(); var layerStock = layers[1]; layerStock.highlight({"DEBW522AA0001585e":Cesium.Color.fromCssColorString("#BB8FCE")}) try { $.ajax({ async: false, type: "POST", url: '/getSimS', data: internStuff }).done(function (SimSMid) { convertdata(SimSMid); }); function convertdata(SimSMids) { SimSOutput = SimSMids; } // console.log(currentwind); return SimSOutput; } catch (err) { console.log('-> function callSimS() failed!\n' + err); } } function fixJson(JsonString) { var objOne = JsonString JsonString = "{" + JsonString + "}" JsonString = JsonString.replace(/DEN/g, ',"DEN') JsonString = JsonString.replace(/ing/g, 'ing"') JsonString = JsonString.replace("ly", 'ly"') // JsonString = JsonString.replace(/]/g, '],') JsonString = JsonString.replace(/=/g, ':') JsonString = JsonString.replace(',"DEN', '"DEN') // JsonString = JsonString.replace("=", '":') console.log(JsonString) return(JsonString) }