diff --git a/public/js/appCesium.js b/public/js/appCesium.js index 5cef36b1284955fe398ac10a366aa8e07ee1deb7..6efc42e237588ce52af2cdf99064520844204143 100644 --- a/public/js/appCesium.js +++ b/public/js/appCesium.js @@ -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")'], + ], + }, + }); +};