Commit 8b532b40 authored by BujarMuharemi's avatar BujarMuharemi
Browse files

fixed pvPotential radio btn controller; works now

parent bb156b4f
//Shadow palette for coloring the roofs //Shadow palette for coloring the roofs
// color pallet from https://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3 // color pallet from https://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3
var pvPotentialPallet = ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#034e7b'] var pvPotentialPallet = ['#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#034e7b']
pvPotentialPallet = pvPotentialPallet.reverse(); pvPotentialPallet = pvPotentialPallet.reverse();
//color pallet white->black //color pallet white->black
......
...@@ -20,6 +20,7 @@ var roofViewActivated = false; ...@@ -20,6 +20,7 @@ var roofViewActivated = false;
var chosenAttributeRadioBtnFlag = "shadowValue"; var chosenAttributeRadioBtnFlag = "shadowValue";
function chosenAttributeHandler(radioBtnValue) { function chosenAttributeHandler(radioBtnValue) {
chosenAttributeRadioBtnFlag = radioBtnValue.value; chosenAttributeRadioBtnFlag = radioBtnValue.value;
} }
...@@ -319,6 +320,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { ...@@ -319,6 +320,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
//Surface View @onLeftClick //Surface View @onLeftClick
if (document.getElementById("surface").checked) { if (document.getElementById("surface").checked) {
resetRoofColors(); resetRoofColors();
setMinAndMax(chosenAttributeRadioBtnFlag);
//save the selected feature's original color //save the selected feature's original color
if (pickedhigh) { if (pickedhigh) {
highlightedFeatures.forEach(h => { highlightedFeatures.forEach(h => {
...@@ -334,7 +336,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { ...@@ -334,7 +336,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
//used for debugging, when clicking on a surface //used for debugging, when clicking on a surface
//console.log(t.getProperty("description") + "\n" + t.getProperty("feature_type") + "\n" + t.getProperty("gml_id") + "\n" + t.getProperty("gml_parent_id")); //console.log(t.getProperty("description") + "\n" + t.getProperty("feature_type") + "\n" + t.getProperty("gml_id") + "\n" + t.getProperty("gml_parent_id"));
t.color = Cesium.Color.LIME; //t.color = Cesium.Color.LIME;
//color surfaces depending on their shadow value //color surfaces depending on their shadow value
for (const [key, value] of Object.entries(shadowdata)) { //looping threw the shadowdata array for (const [key, value] of Object.entries(shadowdata)) { //looping threw the shadowdata array
...@@ -353,15 +355,15 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { ...@@ -353,15 +355,15 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
console.log(pvPotentialSurfaces); console.log(pvPotentialSurfaces);
//coloring surfaces on pv potential //coloring surfaces on pv potential
setMinAndMax(chosenAttributeRadioBtnFlag);
console.log("minie maus", minAndMaxPvPotentials); console.log("minie maus", minAndMaxPvPotentials);
for (const [key, value] of Object.entries(pvPotentialSurfaces)) { 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; var normalizedPvValue;
chosenPvPotentialValue = value["attributes"]["pvPotential"][chosenAttributeRadioBtnFlag]; chosenPvPotentialValue = value["attributes"]["pvPotential"][chosenAttributeRadioBtnFlag];
//console.log("normalisierter",chosenPvPotentialValue); console.log("chosenPvPotentialValue",chosenPvPotentialValue);
console.log("klick");
normalizedPvValue = getNormalizedValue(chosenPvPotentialValue); normalizedPvValue = getNormalizedValue(chosenPvPotentialValue);
console.log("normalisierter", normalizedPvValue); console.log("normalisierter", normalizedPvValue);
t.color = Cesium.Color.fromCssColorString(getColorFromPalette(normalizedPvValue, "pvPotential")); //coloring the surface t.color = Cesium.Color.fromCssColorString(getColorFromPalette(normalizedPvValue, "pvPotential")); //coloring the surface
......
...@@ -18,6 +18,7 @@ function setMinAndMax(pvPotentialValue) { ...@@ -18,6 +18,7 @@ function setMinAndMax(pvPotentialValue) {
minAndMaxPvPotentials=[]; minAndMaxPvPotentials=[];
minAndMaxPvPotentials.push(pvPotentials[0]); minAndMaxPvPotentials.push(pvPotentials[0]);
minAndMaxPvPotentials.push(pvPotentials[pvPotentials.length - 1]); minAndMaxPvPotentials.push(pvPotentials[pvPotentials.length - 1]);
console.log("setMinAndMax calculated");
} }
function getNormalizedValue(selectedPvPotentialValue) { function getNormalizedValue(selectedPvPotentialValue) {
......
...@@ -8,13 +8,11 @@ ...@@ -8,13 +8,11 @@
<!-- Tell IE to use the latest, best version. --> <!-- Tell IE to use the latest, best version. -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- Make the application on mobile take up the full browser screen and disable user scaling. --> <!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
<meta name="viewport" <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<!-- Website Title --> <!-- Website Title -->
<title>Team3dViewer!</title> <title>Team3dViewer!</title>
<!-- import bootstrap --> <!-- import bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.1.0/css/flag-icon.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.1.0/css/flag-icon.min.css" rel="stylesheet">
<!-- import font-awesome --> <!-- import font-awesome -->
...@@ -33,6 +31,7 @@ ...@@ -33,6 +31,7 @@
margin: 0; margin: 0;
overflow: hidden; overflow: hidden;
} }
</style> </style>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js" integrity="sha512-AA1Bzp5Q0K1KanKKmvN/4d3IRKVlv9PYgwFPvm32nPO6QS8yH1HO7LbgB1pgiOxPtfeg5zEn2ba64MUcqJx6CA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js" integrity="sha512-AA1Bzp5Q0K1KanKKmvN/4d3IRKVlv9PYgwFPvm32nPO6QS8yH1HO7LbgB1pgiOxPtfeg5zEn2ba64MUcqJx6CA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
...@@ -106,22 +105,22 @@ ...@@ -106,22 +105,22 @@
}; };
// Process translation // Process translation
$(function () { $(function() {
$('.translate').click(function () { $('.translate').click(function() {
var lang = $(this).attr('id'); var lang = $(this).attr('id');
if (lang === "de") { if (lang === "de") {
document.getElementById("submitID").value = "Senden"; document.getElementById("submitID").value = "Senden";
} } else if (lang === "en") {
else if (lang === "en") {
document.getElementById("submitID").value = "Submit"; document.getElementById("submitID").value = "Submit";
} }
$('.lang').each(function (index, item) { $('.lang').each(function(index, item) {
$(this).text(arrLang[lang][$(this).attr('key')]); $(this).text(arrLang[lang][$(this).attr('key')]);
}); });
}); });
}); });
</script> </script>
</head> </head>
...@@ -151,8 +150,7 @@ ...@@ -151,8 +150,7 @@
<!--Chart and Dropup Button--> <!--Chart and Dropup Button-->
<div id="areaChartContainer"> <div id="areaChartContainer">
<div id="dupbutton" class="btn-group dropup"> <div id="dupbutton" class="btn-group dropup">
<button type="button" class="btn btn-secondary dropdown-toggle lang" data-toggle="dropdown" aria-haspopup="true" <button type="button" class="btn btn-secondary dropdown-toggle lang" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" key='attributes'>Attributes</button>
aria-expanded="false" key='attributes'>Attributes</button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<button id="surfaceChartAttribute" class="dropdown-item lang" key="surface">Surface</button> <button id="surfaceChartAttribute" class="dropdown-item lang" key="surface">Surface</button>
<button id="height" class="dropdown-item lang" type="button" key="height">Height</button> <button id="height" class="dropdown-item lang" type="button" key="height">Height</button>
...@@ -191,8 +189,7 @@ ...@@ -191,8 +189,7 @@
<!--small chart for single Building--> <!--small chart for single Building-->
<div id="singleChartContainer"> <div id="singleChartContainer">
<div id="dupbutton2" class="btn-group dropup"> <div id="dupbutton2" class="btn-group dropup">
<button type="button" class="btn btn-secondary dropdown-toggle lang" data-toggle="dropdown" aria-haspopup="true" <button type="button" class="btn btn-secondary dropdown-toggle lang" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" key="attributes">Attributes
aria-expanded="false" key="attributes">Attributes
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a id="monthlyHeating" class="dropdown-item lang" key="monthlyheating">Monthly Heating</a> <a id="monthlyHeating" class="dropdown-item lang" key="monthlyheating">Monthly Heating</a>
...@@ -236,13 +233,13 @@ ...@@ -236,13 +233,13 @@
<br><br> <br><br>
<input id="submitID" type="button" class="btn btn-primary" value="Submit"> <input id="submitID" type="button" class="btn btn-primary" value="Submit">
</div> </div>
<!--SELECT Adresse--> <!--SELECT Adresse-->
<div class="item"> <div class="item">
<label class="lang" key="chooseaarea" id="arealabel" for="SearchAddress">Search Address:</label> <label class="lang" key="chooseaarea" id="arealabel" for="SearchAddress">Search Address:</label>
<input id="SearchAddress" type="text" name="SearchAddress" > <input id="SearchAddress" type="text" name="SearchAddress">
<br><br> <br><br>
<input id="SerachID" type="button" onclick="searchaddress()" class="btn btn-primary" value="Search"> <input id="SerachID" type="button" onclick="searchaddress()" class="btn btn-primary" value="Search">
</div> </div>
<!--SELECT VIEW--> <!--SELECT VIEW-->
<div class="item"> <div class="item">
<div id="radio-group" class="cc-selector"> <div id="radio-group" class="cc-selector">
...@@ -271,7 +268,7 @@ ...@@ -271,7 +268,7 @@
</div> </div>
<div class="dropp-body"> <div class="dropp-body">
<label><input id="pvPotential" type="radio" key="pvPotential" name="dropp" value="pvPotential" onclick="chosenAttributeHandler(this);"> PV-Value</label>
<label for="specificYield">Specific Yield <label for="specificYield">Specific Yield
<input id="specificYield" type="radio" key="specificYield" name="specificYield" value="specificYield" onclick="chosenAttributeHandler(this);"> <input id="specificYield" type="radio" key="specificYield" name="specificYield" value="specificYield" onclick="chosenAttributeHandler(this);">
</label> </label>
...@@ -301,8 +298,8 @@ ...@@ -301,8 +298,8 @@
</label> </label>
<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>Shadow-Value
<label><input id="shadowValue" type="radio" name="dropp" value="shadowValue" onclick="chosenAttributeHandler(this);"> Shadow-Value</label> <input id="shadowValue" type="radio" name="dropp" value="shadowValue" onclick="chosenAttributeHandler(this);" checked> </label>
</div> </div>
</div> </div>
<div id="chartButton" class="button"> <div id="chartButton" class="button">
...@@ -311,8 +308,7 @@ ...@@ -311,8 +308,7 @@
<!--Draw-menu--> <!--Draw-menu-->
<button class="dropdown-btn"><span class='lang' key='drawbox'>Draw box</span><i class="fa fa-caret-down"></i></button> <button class="dropdown-btn"><span class='lang' key='drawbox'>Draw box</span><i class="fa fa-caret-down"></i></button>
<div class="dropdown-container"> <div class="dropdown-container">
<button class="buttonBlue1" type="button" style="background: rgb(208, 247, 37)" <button class="buttonBlue1" type="button" style="background: rgb(208, 247, 37)" onclick="drawBounding()">
onclick="drawBounding()">
<div class='lang' key='drawbox'>Draw box</div> <div class='lang' key='drawbox'>Draw box</div>
</button> </button>
<br> <br>
...@@ -385,18 +381,16 @@ ...@@ -385,18 +381,16 @@
</div> </div>
</div> </div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</script> </script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous">
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous">
</script> </script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous">
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous">
</script> </script>
<script type="text/javascript" src="js/colorPalettes.js"></script> <script type="text/javascript" src="js/colorPalettes.js"></script>
<script type="text/javascript" src="js/sidebar.js"></script> <script type="text/javascript" src="js/sidebar.js"></script>
<script type="text/javascript" src="js/globe.js"></script> <script type="text/javascript" src="js/globe.js"></script>
<script type="text/javascript" src="js/areaCharts.js"></script> <script type="text/javascript" src="js/areaCharts.js"></script>
......
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