Commit bb156b4f authored by Kolokolnikova's avatar Kolokolnikova
Browse files

pvPotentialRadioButtons

triggers now pvPotentialNormalization
parent baa1f9cd
...@@ -20,8 +20,8 @@ var roofViewActivated = false; ...@@ -20,8 +20,8 @@ var roofViewActivated = false;
var chosenAttributeRadioBtnFlag = "shadowValue"; var chosenAttributeRadioBtnFlag = "shadowValue";
function chosenAttributeHandler(radioBtnValue){ function chosenAttributeHandler(radioBtnValue) {
chosenAttributeRadioBtnFlag=radioBtnValue.value; chosenAttributeRadioBtnFlag = radioBtnValue.value;
} }
//load address //load address
...@@ -342,24 +342,33 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { ...@@ -342,24 +342,33 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
//console.log("hour:",chosenDate.hour); //console.log("hour:",chosenDate.hour);
shadowHourValue = value[chosenDate.hour - 1] //getting the current chosen hour from the timeline shadowHourValue = value[chosenDate.hour - 1] //getting the current chosen hour from the timeline
if(chosenAttributeRadioBtnFlag==="shadowValue"){ if (chosenAttributeRadioBtnFlag === "shadowValue") {
t.color = Cesium.Color.fromCssColorString(getColorFromPalette(shadowHourValue,"shadowValue")); //coloring the surface 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
} }
//t.color = Cesium.Color.fromCssColorString(getShadowPalette(shadowHourValue)); //coloring the surface //t.color = Cesium.Color.fromCssColorString(getShadowPalette(shadowHourValue)); //coloring the surface
} }
} }
console.log(pvPotentialSurfaces); console.log(pvPotentialSurfaces);
//coloring surfaces on pv potential //coloring surfaces on pv potential
for (const [key, value] of Object.entries(pvPotentialSurfaces)) { //looping threw the shadowdata array
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 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); //console.log("hour:",chosenDate.hour);
var normalizedPvValue;
SurfacePvPotential = value["attributes"]["pvPotential"]["totalInvestment"]; 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"]; SurfacePvPotentialObject = value["attributes"]["pvPotential"];
//console.log(SurfacePvPotentialObject); console.log(SurfacePvPotentialObject);
} }
} }
} }
......
...@@ -15,6 +15,7 @@ function setMinAndMax(pvPotentialValue) { ...@@ -15,6 +15,7 @@ function setMinAndMax(pvPotentialValue) {
} }
}); });
pvPotentials = pvPotentials.sort(function(a, b) { return a - b; }); pvPotentials = pvPotentials.sort(function(a, b) { return a - b; });
minAndMaxPvPotentials=[];
minAndMaxPvPotentials.push(pvPotentials[0]); minAndMaxPvPotentials.push(pvPotentials[0]);
minAndMaxPvPotentials.push(pvPotentials[pvPotentials.length - 1]); minAndMaxPvPotentials.push(pvPotentials[pvPotentials.length - 1]);
} }
......
...@@ -302,7 +302,7 @@ ...@@ -302,7 +302,7 @@
<label for="discountedPaybackPeriod">Discounted Payback Period <label for="discountedPaybackPeriod">Discounted Payback Period
<input id="discountedPaybackPeriod" type="radio" key="discountedPaybackPeriod" name="dropp" value="discountedPaybackPeriod" onclick="chosenAttributeHandler(this);"> <input id="discountedPaybackPeriod" type="radio" key="discountedPaybackPeriod" name="dropp" value="discountedPaybackPeriod" onclick="chosenAttributeHandler(this);">
</label> </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> </div>
<div id="chartButton" class="button"> <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