Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
iCity
EnergyDashboard
Commits
ca0d8d3a
Commit
ca0d8d3a
authored
3 years ago
by
Pithon Kabiro
Browse files
Options
Download
Email Patches
Plain Diff
New function: apply styling selected buildings
parent
fdf63e71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/js/appCesium.js
+28
-0
public/js/appCesium.js
with
28 additions
and
0 deletions
+28
-0
public/js/appCesium.js
+
28
-
0
View file @
ca0d8d3a
...
@@ -316,3 +316,31 @@ const resetStylingForAllBuildings = function (targetTileset) {
...
@@ -316,3 +316,31 @@ const resetStylingForAllBuildings = function (targetTileset) {
},
},
});
});
};
};
/**
* Apply a different color to the buildings that are selected in the buildings & data points drop-down list
*
* @param {Object} targetTileset The 3D tileset to be styled
* @param {Array} buildingIdArr An array of building IDs
* @returns {undefined} undefined
*/
const
applyStylingForSelectedBuildings
=
function
(
targetTileset
,
buildingIdArr
)
{
targetTileset
.
style
=
new
Cesium
.
Cesium3DTileStyle
({
color
:
{
conditions
:
[
// The maximum number of buildings = seven
[
"
${_gebaeude} ===
"
+
buildingIdArr
[
0
],
'
color("red")
'
],
[
"
${_gebaeude} ===
"
+
buildingIdArr
[
1
],
'
color("red")
'
],
[
"
${_gebaeude} ===
"
+
buildingIdArr
[
2
],
'
color("red")
'
],
[
"
${_gebaeude} ===
"
+
buildingIdArr
[
3
],
'
color("red")
'
],
[
"
${_gebaeude} ===
"
+
buildingIdArr
[
4
],
'
color("red")
'
],
[
"
${_gebaeude} ===
"
+
buildingIdArr
[
5
],
'
color("red")
'
],
[
"
${_gebaeude} ===
"
+
buildingIdArr
[
6
],
'
color("red")
'
],
[
"
true
"
,
'
color("white")
'
],
],
},
});
};
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
Menu
Explore
Projects
Groups
Snippets