Commit 3f7776db authored by Muharemi's avatar Muharemi
Browse files

Merge branch 'dev' into 'master'

Finale Merge of the dev branch into master

See merge request !1
parents 47071eb3 3e8d28a8
Pipeline #5783 passed with stage
in 49 seconds
public/node_modules/
\ No newline at end of file
{
"indent_size": 4,
"indent_char": " ",
"indent_level": 0,
"end-with-newline": true,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "collapse,preserve-inline",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0,
"css": {
"selector_separator_newline": false
}
}
\ No newline at end of file
......@@ -54,7 +54,7 @@
z-index: -1;
}
#sidebar {
#sidebar {
position:absolute;
top:0px;
left:-200px;
......@@ -84,7 +84,7 @@
}
#sidebar div.list div.item{
padding:15px 10px;
padding:25px 10px;
border-bottom:1px solid #444;
color:#fcfcfc;
text-transform:uppercase;
......@@ -106,6 +106,8 @@
overflow-y: auto;
}
.dropdown-btn {
padding: 15px 10px;
text-decoration: none;
......@@ -124,6 +126,10 @@
background-color: royalblue;
color: white;
}
select { width: 170px;
height: 40px;
}
/* Dropdown container (hidden by default). Optional: add a lighter background color and some left padding to change the design of the dropdown content */
.dropdown-container {
......
//Shadow palette for coloring the roofs
// color pallet from https://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3
var pvPotentialPallet = ['#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#034e7b']
pvPotentialPallet = pvPotentialPallet.reverse();
//color pallet white->black
var colorPalette = ['#bdbdbd', '#969696', '#737373', '#525252', '#252525'];
const shadowPalette = colorPalette;
//returns the responding color from the shadowPalette, depending on the inputShadowValue(0 to 1 in float)
function getShadowPalette(inputShadowValue) {
//checking for the float values
var index = Math.ceil((shadowPalette.length - 1) * inputShadowValue);
//console.log(inputShadowValue,"---",shadowPalette[index]);
return shadowPalette[index];
}
/** returns a color from the chosen colorpalette, depending on the inputvalue
* @param {float} inputValue - inputValue on which the colorpalette should be calculated (normalized range 0.0-1.0)
* @param {string} colorPalette - "pvPotential" or "shadowValue"
* @returns {string} a hex color string
*/
function getColorFromPalette(inputValue,colorPalette) {
//returns the responding color from the shadowPalette, depending on the inputShadowValue(0 to 1 in float)
if(colorPalette==="shadowValue"){
var index = Math.ceil((shadowPalette.length - 1) * inputValue); //checking for the float values
return shadowPalette[index];
}else if(colorPalette==="pvPotential"){
var index = Math.ceil((pvPotentialPallet.length - 1) * inputValue); //checking for the float values
return pvPotentialPallet[index];
}else{
throw "chose wrong colorPalette";
}
}
This diff is collapsed.
......@@ -8,7 +8,7 @@ var rectVisible = false;
var Pickers_3DTile_Activated = true;
var bboxactivated = false;
var currentLayer;
var drawBox = false
var drawBox = false;
//draw rectangle
function drawBounding() {
......@@ -19,6 +19,8 @@ function drawBounding() {
drawBox = true
}
//fills coordinates array (used to fetch data)
function createRequest_BB() {
console.log("-->clicked confirm button")
......
//filling the table in the info sidebar with data
function fillTableProperties(gID, sID) {
if (drawBox === false) {
swal("CAN'T LOAD DATA!", "mark an area first!", "error");
document.getElementById("singleChartContainer").style.visibility = "hidden"
document.getElementsByClassName('cesium-infoBox-defaultTable').style.display = 'none';
} else {
//Property BuildingFunction
buildingFunctionSortPick.forEach((value, key) => {
if (key === gID) {
pickBuildingFunction = value
}
})
//Property Year of Construction
constructionYearSortPick.forEach((value, key) => {
if (key === gID) {
pickYearOfConstruction = value
}
})
//Property height
heightSortPick.forEach((value, key) => {
if (key === gID) {
pickHeight = value
}
})
//Property HeatedVolume
heatedVolumeSortPick.forEach((value, key) => {
if (key === gID) {
pickHeatedVolume = value
}
})
//Property TotalSurfaceArea
totalSurfaceAreaSortPick.forEach((value, key) => {
if (key === gID) {
var sum = 0
value.forEach(element => {
sum += element.totalSurfaceArea
});
pickTotalSurfaceArea = sum
}
})
//Property RoofType
roofTypeSortPick.forEach((value, key) => {
if (key === gID) {
pickRoofType = value
}
})
//Property UValue
uValueSortPick.forEach((value, key) => {
if (key === sID) {
pickUValue = value
}
})
}
}
\ No newline at end of file
This diff is collapsed.
/** Documentation:
* Function is used to calculate normalized pvPotential data
* it normalizes every value from the array
*/
var minAndMaxPvPotentials = [];
//getting the min and max for each attributes
function setMinAndMax(pvPotentialValue) {
let pvPotentials = [];
pvPotentialSurfaces.forEach(t => {
for (const [key, value] of Object.entries(t.attributes.pvPotential)) {
if (key === pvPotentialValue) {
pvPotentials.push(value);
}
}
});
pvPotentials = pvPotentials.sort(function(a, b) { return a - b; });
minAndMaxPvPotentials = [];
minAndMaxPvPotentials.push(pvPotentials[0]);
minAndMaxPvPotentials.push(pvPotentials[pvPotentials.length - 1]);
console.log("setMinAndMax calculated");
}
//calculating the normalized value for the selected pvPotential value
function getNormalizedValue(selectedPvPotentialValue) {
var normalizedValue;
if (minAndMaxPvPotentials[1] - minAndMaxPvPotentials[0] !== 0) {
normalizedValue = (selectedPvPotentialValue - minAndMaxPvPotentials[0]) / (minAndMaxPvPotentials[1] - minAndMaxPvPotentials[0]);
} else {
normalizedValue = 1;
}
return normalizedValue;
}
/**
* Used for the search address feature
*/
//load address
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var coordinate = JSON.parse(request.responseText);
var lat = coordinate.results[0].geometry.lat;
var lng = coordinate.results[0].geometry.lng;
console.log(lat + " " + lng);
fly(lat, lng);
}
}
//sending a request to the opencage api to convert the input to coordinates
function searchaddress() {
var query = document.getElementById('SearchAddress').value;
request.open("GET", 'https://api.opencagedata.com/geocode/v1/json?key=c73da14969e6408ab4535b3ad6dc43ea&pretty=1&no_annotations=1&q=' + query, true);
request.send();
}
//used to fly to the found position
function fly(lat, lng) {
var pinBuilder = new Cesium.PinBuilder();
var bluePin = viewer.entities.add({
name: "Blank blue pin",
position: Cesium.Cartesian3.fromDegrees(lng, lat),
billboard: {
image: pinBuilder.fromColor(Cesium.Color.ROYALBLUE, 48).toDataURL(),
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
},
});
viewer.zoomTo(bluePin);
viewer.flyTo(bluePin);
}
\ No newline at end of file
......@@ -4,75 +4,73 @@ var radio = document.getElementById('radio-group');
var filterswitches = document.getElementById('filterswitches');
//Show / hide chart
chartButton.addEventListener('click', function () {
//sets as default attribute building function
myChartArea("bar", "Building Function", 1, "Building Type", "Frequency", coloR);
addGlobalData(areaChart, buildingType, btFrequency, btFrequency.length)
chartButton.addEventListener('click', function() {
//sets as default attribute building function
myChartArea("bar", "Building Function", 1, "Building Type", "Frequency", coloR);
addGlobalData(areaChart, buildingType, btFrequency, btFrequency.length)
if (drawBox === false) {
swal("CAN'T LOAD DATA!", "mark an area first!", "error");
} else {
var x = document.getElementById('areaChartContainer');
if (x.style.visibility === 'visible') {
//button.firstChild.data = "Show chart";
x.style.visibility = 'hidden';
if (drawBox === false) {
swal("CAN'T LOAD DATA!", "mark an area first!", "error");
} else {
//button.firstChild.data = "Hide chart";
x.style.visibility = 'visible';
}
}
}, false);
var x = document.getElementById('areaChartContainer');
heatingdemand.addEventListener('click', function () {
var x = document.getElementById('heat-demand-legend');
if (!document.getElementById('checkbox2').checked) {
x.style.visibility = 'hidden';
} else {
x.style.visibility = 'visible';
}
if (x.style.visibility === 'visible') {
//button.firstChild.data = "Show chart";
x.style.visibility = 'hidden';
} else {
//button.firstChild.data = "Hide chart";
x.style.visibility = 'visible';
}
}
}, false);
radio.addEventListener('click', function () {
if (document.getElementById("surface").checked) {
document.getElementById("checkbox1").disabled = false;
document.getElementById("checkbox2").disabled = true;
if (document.getElementById("checkbox2").checked) {
document.getElementById("checkbox2").checked = false;
document.getElementById('heat-demand-legend').style.visibility = 'hidden';
tileContent.forEach(t => t.color = new Cesium.Color(1, 1, 1, 1))
}
}
else {
document.getElementById("checkbox1").disabled = true;
document.getElementById("checkbox2").disabled = false;
if (document.getElementById("checkbox1").checked) {
document.getElementById("checkbox1").checked = false;
tileContent.forEach(t => t.color = new Cesium.Color(1, 1, 1, 1))
heatingdemand.addEventListener('click', function() {
var x = document.getElementById('heat-demand-legend');
if (!document.getElementById('checkbox2').checked) {
x.style.visibility = 'hidden';
} else {
x.style.visibility = 'visible';
}
}
}, false);
filterswitches.addEventListener('click', function () {
if (drawBox === false) {
swal("CAN'T LOAD DATA!", "mark an area first!", "error");
document.getElementById("checkbox2").disabled = true;
document.getElementById("checkbox1").disabled = true;
} else {
radio.addEventListener('click', function() {
if (document.getElementById("surface").checked) {
document.getElementById("checkbox1").disabled = false;
document.getElementById("checkbox2").disabled = true;
document.getElementById("checkbox1").disabled = false;
document.getElementById("checkbox2").disabled = true;
if (document.getElementById("checkbox2").checked) {
document.getElementById("checkbox2").checked = false;
document.getElementById('heat-demand-legend').style.visibility = 'hidden';
tileContent.forEach(t => t.color = new Cesium.Color(1, 1, 1, 1))
}
} else {
document.getElementById("checkbox1").disabled = true;
document.getElementById("checkbox2").disabled = false;
if (document.getElementById("checkbox1").checked) {
document.getElementById("checkbox1").checked = false;
tileContent.forEach(t => t.color = new Cesium.Color(1, 1, 1, 1))
}
}
else {
document.getElementById("checkbox1").disabled = true;
document.getElementById("checkbox2").disabled = false;
}, false);
filterswitches.addEventListener('click', function() {
if (drawBox === false) {
swal("CAN'T LOAD DATA!", "mark an area first!", "error");
document.getElementById("checkbox2").disabled = true;
document.getElementById("checkbox1").disabled = true;
} else {
if (document.getElementById("surface").checked) {
document.getElementById("checkbox1").disabled = false;
document.getElementById("checkbox2").disabled = true;
} else {
document.getElementById("checkbox1").disabled = true;
document.getElementById("checkbox2").disabled = false;
}
}
}
}, false);
function toggleSidebar(ref) {
document.getElementById("sidebar").classList.toggle('active');
document.getElementById("sidebar").classList.toggle('active');
}
//loop through all dropdown buttons to toggle between hiding and showing its dropdown content
......@@ -80,13 +78,13 @@ var dropdown = document.getElementsByClassName("dropdown-btn");
var i;
for (i = 0; i < dropdown.length; i++) {
dropdown[i].addEventListener("click", function () {
this.classList.toggle("active");
var dropdownContent = this.nextElementSibling;
if (dropdownContent.style.display === "block") {
dropdownContent.style.display = "none";
} else {
dropdownContent.style.display = "block";
}
});
dropdown[i].addEventListener("click", function() {
this.classList.toggle("active");
var dropdownContent = this.nextElementSibling;
if (dropdownContent.style.display === "block") {
dropdownContent.style.display = "none";
} else {
dropdownContent.style.display = "block";
}
});
}
......@@ -27,7 +27,7 @@ function test() {
p.attributes.monthlyHeating,
p.attributes.monthlyCooling)))
buildingsMAP.set(bu.id, new Building(bu.id, partsArray)) //puts buildings with parts and surfaces in a map
buildingsMAP.set(bu.id, new Building(bu.id, partsArray)) //puts buildings with parts and surfaces in a map
})
......@@ -104,7 +104,7 @@ function test() {
sortMap()
//color buildings with heating demand
document.getElementById("checkbox2").addEventListener("change", function () {
document.getElementById("checkbox2").addEventListener("change", function() {
if (this.checked) {
tileContent.forEach(t => {
let tileID = t.getProperty("gml_parent_id")
......@@ -124,7 +124,7 @@ function test() {
})
//color surfaces with uValue
document.getElementById("checkbox1").addEventListener("change", function () {
document.getElementById("checkbox1").addEventListener("change", function() {
if (this.checked) {
tileContent.forEach(t => {
let tileID = t.getProperty("gml_id")
......@@ -143,4 +143,3 @@ function test() {
}
})
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"asset" : {
"version" : "0.0"
},
"properties" : {
"gml_id" : {},
"gml_parent_id" : {},
"description" : {},
"feature_type" : {}
},
"geometricError" : 84.7033050210448,
"root" : {
"boundingVolume" : {
"box" : [ 4157183.4193600416, 671263.025354151, 4774688.139831596, 209.53922537481412, 0, 0, 0, 226.20286488952115, 0, 0, 0, 159.76538479700685 ]
},
"geometricError" : 84.7033050210448,
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157183.0913853333, 671276.9167505095, 4774688.139831596, 208.88327595870942, 0, 0, 0, 198.420072172652, 0, 0, 0, 159.76538479700685 ]
},
"url" : "/public/test/tileset/data/data0.b3dm"
},
"children" : [
{
"boundingVolume" : {
"box" : [ 4157228.114850776, 671251.5544893676, 4774660.327885907, 43.80110447667539, 0, 0, 0, 12.856712591368705, 0, 0, 0, 53.52015439514071 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157228.114850776, 671251.5544893676, 4774660.327885907, 43.80110447667539, 0, 0, 0, 12.856712591368705, 0, 0, 0, 53.52015439514071 ]
},
"url" : "/public/test/tileset/data/data1.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4157259.0075245854, 671237.0161895596, 4774633.671508187, 58.36289628734812, 0, 0, 0, 60.476301041897386, 0, 0, 0, 50.82873797882348 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157259.0075245854, 671237.0161895596, 4774633.671508187, 58.36289628734812, 0, 0, 0, 60.476301041897386, 0, 0, 0, 50.82873797882348 ]
},
"url" : "/public/test/tileset/data/data2.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4157260.196087419, 671251.9858865617, 4774636.8328062985, 25.79576786607504, 0, 0, 0, 29.950261512654833, 0, 0, 0, 44.506141755729914 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157260.196087419, 671251.9858865617, 4774636.8328062985, 25.79576786607504, 0, 0, 0, 29.950261512654833, 0, 0, 0, 44.506141755729914 ]
},
"url" : "/public/test/tileset/data/data3.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4157223.877246985, 671278.8423610204, 4774660.5079447515, 20.377759689930826, 0, 0, 0, 193.8928428903455, 0, 0, 0, 22.34141970332712 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157223.877246985, 671278.8423610204, 4774660.5079447515, 20.377759689930826, 0, 0, 0, 193.8928428903455, 0, 0, 0, 22.34141970332712 ]
},
"url" : "/public/test/tileset/data/data4.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4157211.0689755557, 671179.0722945668, 4774667.161378037, 61.64202992897481, 0, 0, 0, 58.29674572101794, 0, 0, 0, 57.427568226121366 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157211.0689755557, 671179.0722945668, 4774667.161378037, 61.64202992897481, 0, 0, 0, 58.29674572101794, 0, 0, 0, 57.427568226121366 ]
},
"url" : "/public/test/tileset/data/data5.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4157225.063591961, 671175.3949235276, 4774673.084528787, 21.286791074555367, 0, 0, 0, 20.521639954065904, 0, 0, 0, 20.94711357820779 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157225.063591961, 671175.3949235276, 4774673.084528787, 21.286791074555367, 0, 0, 0, 20.521639954065904, 0, 0, 0, 20.94711357820779 ]
},
"url" : "/public/test/tileset/data/data6.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4157172.530755615, 671226.8655617537, 4774696.573534641, 138.71846981020644, 0, 0, 0, 106.83504467795137, 0, 0, 0, 116.25188143644482 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157172.530755615, 671226.8655617537, 4774696.573534641, 138.71846981020644, 0, 0, 0, 106.83504467795137, 0, 0, 0, 116.25188143644482 ]
},
"url" : "/public/test/tileset/data/data7.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4157234.735237984, 671184.0981509301, 4774663.504809576, 1.9434990277513862, 0, 0, 0, 3.1151851491304114, 0, 0, 0, 1.7876751571893692 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157234.735237984, 671184.0981509301, 4774663.504809576, 1.9434990277513862, 0, 0, 0, 3.1151851491304114, 0, 0, 0, 1.7876751571893692 ]
},
"url" : "/public/test/tileset/data/data8.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4157192.6996459886, 671343.1874950464, 4774673.3595239995, 76.89431473286822, 0, 0, 0, 65.87858309876174, 0, 0, 0, 87.54443842731416 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157192.6996459886, 671343.1874950464, 4774673.3595239995, 76.89431473286822, 0, 0, 0, 65.87858309876174, 0, 0, 0, 87.54443842731416 ]
},
"url" : "/public/test/tileset/data/data9.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4157146.0018855724, 671293.6001087409, 4774719.744891234, 134.70427643693984, 0, 0, 0, 99.23852986039128, 0, 0, 0, 96.55526552256197 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4157146.0018855724, 671293.6001087409, 4774719.744891234, 134.70427643693984, 0, 0, 0, 99.23852986039128, 0, 0, 0, 96.55526552256197 ]
},
"url" : "/public/test/tileset/data/data10.b3dm"
}
}
]
}
}
\ No newline at end of file
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