Commit ca0d8d3a authored by Pithon Kabiro's avatar Pithon Kabiro
Browse files

New function: apply styling selected buildings

parent fdf63e71
......@@ -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")'],
],
},
});
};
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