Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SimStadt
3DClient4SimStadtAPI
Commits
8b532b40
Commit
8b532b40
authored
Jan 13, 2022
by
BujarMuharemi
Browse files
fixed pvPotential radio btn controller; works now
parent
bb156b4f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
public/js/colorPalettes.js
View file @
8b532b40
//Shadow palette for coloring the roofs
// 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
();
//color pallet white->black
...
...
public/js/globe.js
View file @
8b532b40
...
...
@@ -20,6 +20,7 @@ var roofViewActivated = false;
var
chosenAttributeRadioBtnFlag
=
"
shadowValue
"
;
function
chosenAttributeHandler
(
radioBtnValue
)
{
chosenAttributeRadioBtnFlag
=
radioBtnValue
.
value
;
}
...
...
@@ -319,6 +320,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
//Surface View @onLeftClick
if
(
document
.
getElementById
(
"
surface
"
).
checked
)
{
resetRoofColors
();
setMinAndMax
(
chosenAttributeRadioBtnFlag
);
//save the selected feature's original color
if
(
pickedhigh
)
{
highlightedFeatures
.
forEach
(
h
=>
{
...
...
@@ -334,7 +336,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
//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"));
t
.
color
=
Cesium
.
Color
.
LIME
;
//
t.color = Cesium.Color.LIME;
//color surfaces depending on their shadow value
for
(
const
[
key
,
value
]
of
Object
.
entries
(
shadowdata
))
{
//looping threw the shadowdata array
...
...
@@ -353,15 +355,15 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
console
.
log
(
pvPotentialSurfaces
);
//coloring surfaces on pv potential
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
"
);
console
.
log
(
"
chosenPvPotentialValue
"
,
chosenPvPotentialValue
);
normalizedPvValue
=
getNormalizedValue
(
chosenPvPotentialValue
);
console
.
log
(
"
normalisierter
"
,
normalizedPvValue
);
t
.
color
=
Cesium
.
Color
.
fromCssColorString
(
getColorFromPalette
(
normalizedPvValue
,
"
pvPotential
"
));
//coloring the surface
...
...
public/js/pvPotentialNormalization.js
View file @
8b532b40
...
...
@@ -18,6 +18,7 @@ function setMinAndMax(pvPotentialValue) {
minAndMaxPvPotentials
=
[];
minAndMaxPvPotentials
.
push
(
pvPotentials
[
0
]);
minAndMaxPvPotentials
.
push
(
pvPotentials
[
pvPotentials
.
length
-
1
]);
console
.
log
(
"
setMinAndMax calculated
"
);
}
function
getNormalizedValue
(
selectedPvPotentialValue
)
{
...
...
public/main.html
View file @
8b532b40
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment