diff --git a/public/js/globe.js b/public/js/globe.js index 981bf1f4892c369a5839d4da1c99ab8bab1d7cf4..e2f36be63daaf6b973a4e205eaf4349b047f1ce1 100644 --- a/public/js/globe.js +++ b/public/js/globe.js @@ -273,7 +273,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { //Surface View if (document.getElementById("surface").checked) { - + resetRoofColors(); //save the selected feature's original color if (pickedhigh) { highlightedFeatures.forEach(h => { @@ -339,6 +339,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { //Building View else if(document.getElementById("building").checked){ + resetRoofColors(); //save the selected feature's original color if (pickedhigh) { highlightedFeatures.forEach(h => { @@ -480,3 +481,16 @@ function fillTableProperties(gID, sID) { } } + + +function resetRoofColors(){ + tileContent.forEach(t => { + if(t.getProperty("description").includes("Roof")){ + for (const [key, value] of Object.entries(shadowdata)) { + if(key === t.getProperty("gml_id")){ + t.color = Cesium.Color.WHITE; + } + } + } + }); +}