Commit d8296f27 authored by BujarMuharemi's avatar BujarMuharemi
Browse files

fixed shadow coloring;fixed showing of chosen att.

parent 84e8a921
......@@ -5,8 +5,8 @@ var pvPotentialPallet = ['#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0',
pvPotentialPallet = pvPotentialPallet.reverse();
//color pallet white->black
var colorPalette = ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525'];
const shadowPalette = colorPalette.reverse();
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) {
......
......@@ -347,9 +347,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
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);
......@@ -358,14 +356,14 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
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") && chosenAttributeRadioBtnFlag !== "shadowValue") { //checking if the ids of the current surface match the id in the shadowdata array
//console.log("hour:",chosenDate.hour);
var normalizedPvValue;
var normalizedPvValue="";
chosenPvPotentialValue = value["attributes"]["pvPotential"][chosenAttributeRadioBtnFlag];
console.log("chosenPvPotentialValue",chosenPvPotentialValue);
normalizedPvValue = getNormalizedValue(chosenPvPotentialValue);
console.log("normalisierter", normalizedPvValue);
console.log("normalisierter", normalizedPvValue);
t.color = Cesium.Color.fromCssColorString(getColorFromPalette(normalizedPvValue, "pvPotential")); //coloring the surface
SurfacePvPotential = chosenPvPotentialValue;
......@@ -390,7 +388,16 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
});
}
var shadowhourvaluepercent = 100 - (shadowHourValue * 100)
var chosenAttribute2Show = "";
var shadowhourvaluepercent = shadowHourValue * 100;
console.log("shadowHourValue:",shadowHourValue*100,"\n shadowhourvaluepercent:",shadowhourvaluepercent);
if(chosenAttributeRadioBtnFlag==="shadowValue"){
chosenAttribute2Show ="<tr><th>shadow value</th><td>" + shadowhourvaluepercent.toFixed(1) + "%" + "</td></tr>";
}else{
chosenAttribute2Show = "<tr><th>"+chosenAttributeRadioBtnFlag+"</th><td>" + SurfacePvPotential + "</td></tr>";
}
//set feature infobox description (surface view)
var featureName = pickedFeature.getProperty("name");
selectedEntity.name = featureName;
......@@ -402,9 +409,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
"<tr><th>u_Value</th><td>" + pickUValue + "</td></tr>" +
"<tr><th>description</th><td>" + pickedFeature.getProperty("description") + "</td></tr>" +
"<tr><th>feature_type</th><td>" + pickedFeature.getProperty("feature_type") + "</td></tr>" +
"<tr><th>shadow value</th><td>" + shadowhourvaluepercent.toFixed(1) + "%" + "</td></tr>" +
"<tr><th>"+chosenAttributeRadioBtnFlag+"</th><td>" + SurfacePvPotential + "</td></tr>" +
chosenAttribute2Show;
"</tbody></table>";
......
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