Commit bb156b4f authored by Kolokolnikova's avatar Kolokolnikova
Browse files

pvPotentialRadioButtons

triggers now pvPotentialNormalization
parent baa1f9cd
......@@ -20,8 +20,8 @@ var roofViewActivated = false;
var chosenAttributeRadioBtnFlag = "shadowValue";
function chosenAttributeHandler(radioBtnValue){
chosenAttributeRadioBtnFlag=radioBtnValue.value;
function chosenAttributeHandler(radioBtnValue) {
chosenAttributeRadioBtnFlag = radioBtnValue.value;
}
//load address
......@@ -315,7 +315,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
//fill variables for Single Building Properties
fillTableProperties(gmlID, surID)
//Surface View @onLeftClick
if (document.getElementById("surface").checked) {
resetRoofColors();
......@@ -341,25 +341,34 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
if (key === t.getProperty("gml_id")) { //checking if the ids of the current surface match the id in the shadowdata array
//console.log("hour:",chosenDate.hour);
shadowHourValue = value[chosenDate.hour - 1] //getting the current chosen hour from the timeline
if(chosenAttributeRadioBtnFlag==="shadowValue"){
t.color = Cesium.Color.fromCssColorString(getColorFromPalette(shadowHourValue,"shadowValue")); //coloring the surface
}else if(chosenAttributeRadioBtnFlag==="pvPotential"){
t.color = Cesium.Color.fromCssColorString(getColorFromPalette(shadowHourValue,"pvPotential")); //coloring the surface
if (chosenAttributeRadioBtnFlag === "shadowValue") {
t.color = Cesium.Color.fromCssColorString(getColorFromPalette(shadowHourValue, "shadowValue")); //coloring the surface
}
//t.color = Cesium.Color.fromCssColorString(getShadowPalette(shadowHourValue)); //coloring the surface
}
}
console.log(pvPotentialSurfaces);
//coloring surfaces on pv potential
for (const [key, value] of Object.entries(pvPotentialSurfaces)) { //looping threw the shadowdata array
if (value["id"] === t.getProperty("gml_id")) { //checking if the ids of the current surface match the id in the shadowdata array
//console.log("hour:",chosenDate.hour);
SurfacePvPotential = value["attributes"]["pvPotential"]["totalInvestment"];
setMinAndMax(chosenAttributeRadioBtnFlag);
console.log("minie maus", minAndMaxPvPotentials);
for (const [key, value] of Object.entries(pvPotentialSurfaces)) {
if (value["id"] === t.getProperty("gml_id")) { //checking if the ids of the current surface match the id in the shadowdata array
//console.log("hour:",chosenDate.hour);
var normalizedPvValue;
chosenPvPotentialValue = value["attributes"]["pvPotential"][chosenAttributeRadioBtnFlag];
//console.log("normalisierter",chosenPvPotentialValue);
console.log("klick");
normalizedPvValue = getNormalizedValue(chosenPvPotentialValue);
console.log("normalisierter", normalizedPvValue);
t.color = Cesium.Color.fromCssColorString(getColorFromPalette(normalizedPvValue, "pvPotential")); //coloring the surface
// SurfacePvPotential = value["attributes"]["pvPotential"][chosenAttributeRadioBtnFlag];
SurfacePvPotentialObject = value["attributes"]["pvPotential"];
//console.log(SurfacePvPotentialObject);
console.log(SurfacePvPotentialObject);
}
}
}
......
......@@ -15,6 +15,7 @@ function setMinAndMax(pvPotentialValue) {
}
});
pvPotentials = pvPotentials.sort(function(a, b) { return a - b; });
minAndMaxPvPotentials=[];
minAndMaxPvPotentials.push(pvPotentials[0]);
minAndMaxPvPotentials.push(pvPotentials[pvPotentials.length - 1]);
}
......
......@@ -302,7 +302,7 @@
<label for="discountedPaybackPeriod">Discounted Payback Period
<input id="discountedPaybackPeriod" type="radio" key="discountedPaybackPeriod" name="dropp" value="discountedPaybackPeriod" onclick="chosenAttributeHandler(this);">
</label>
<label><input id="shadowValue" type="radio" name="dropp" value="shadowValue" checked onclick="chosenAttributeHandler(this);"> Shadow-Value</label>
<label><input id="shadowValue" type="radio" name="dropp" value="shadowValue" onclick="chosenAttributeHandler(this);"> Shadow-Value</label>
</div>
</div>
<div id="chartButton" class="button">
......
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