function oldZust(){ var layerNamesToDeactivate = ["Rosenstein"] var layers = framework.getLayers(); for (var i = 0; i< layers.length; i++) { var layer = layers[i]; if(layerNamesToDeactivate.indexOf(layer.getName()) >= 0) { layer.activate(false); }} var layerNamesToActivate = ["StuttgartPart"] var layersA = framework.getLayers(); for (var i = 0; i< layersA.length; i++) { var layerA = layersA[i]; if(layerNamesToActivate.indexOf(layerA.getName()) >= 0) { layerA.activate(true); }} checkboxHighlight(false); checkboxDemand(false); // var layerIndexStockach // var layernameStockach = ["Stöckach"] // var frameworkZus = vcs.vcm.Framework.getInstance(); // var layersZus = frameworkZus.getLayers(); // for (var i = 0; i< layersZus.length; i++) { // var layerst = layersZus[i]; // if(layernameStockach.indexOf(layerst.getName()) >= 0) { // layerIndexStockach = i // }} // var layerStock = layersZus[layerIndexStockach]; // layerStock.showObjects(["DEBW522AA00022dcc", "DEBW522AA0003bf3b","DEBW522AA0000976a","DEBW522AA00001d00"]); } function newPlan(){ var layerNamesToActivate = ["Rosenstein"] var layers = framework.getLayers(); for (var i = 0; i< layers.length; i++) { var layer = layers[i]; if(layerNamesToActivate.indexOf(layer.getName()) >= 0) { layer.activate(true); }} var layerNamesToDeactivate = ["StuttgartPart"] var layersA = framework.getLayers(); for (var i = 0; i< layersA.length; i++) { var layerA = layersA[i]; if(layerNamesToDeactivate.indexOf(layerA.getName()) >= 0) { layerA.activate(false); }} checkboxHighlight(false); checkboxDemand(false); // var layerIndexStockach // var layernameStockach = ["Stöckach"] // var frameworkZus = vcs.vcm.Framework.getInstance(); // var layersZus = frameworkZus.getLayers(); // for (var i = 0; i< layersZus.length; i++) { // var layerst = layersZus[i]; // if(layernameStockach.indexOf(layerst.getName()) >= 0) { // layerIndexStockach = i // }} // var layerStock = layersZus[layerIndexStockach]; // layerStock.hideObjects(["DEBW522AA00022dcc", "DEBW522AA0003bf3b","DEBW522AA0000976a","DEBW522AA00001d00"]); } function checkboxHighlight(change){ var chk_ceil= document.getElementById("chxboxHighlight"); if(chk_ceil.checked == true){ if(change==true){ document.getElementById("chxboxDemand").checked = false; } highlightStuff(); } else { if( document.getElementById("chxboxDemand").checked==false){ unhighlightStuff(); } // if(change==true){ // document.getElementById("chxboxDemand").checked = false; // } } }; function checkboxDemand(change){ var chk_ceil= document.getElementById("chxboxDemand"); if(chk_ceil.checked == true){ if(change==true){ document.getElementById("chxboxHighlight").checked = false; } highlightEnergy(); } else { if(document.getElementById("chxboxHighlight").checked == false){ unhighlightStuff(); } // if(change==true){ // document.getElementById("chxboxHighlight").checked = false; // } } }; function highlightStuff() { var layerIndexStockach var layernameStockach = ["Stöckach"] var frameworkZus = vcs.vcm.Framework.getInstance(); var layersZus = frameworkZus.getLayers(); for (var i = 0; i< layersZus.length; i++) { var layerst = layersZus[i]; if(layernameStockach.indexOf(layerst.getName()) >= 0) { layerIndexStockach = i }} highlightBuildings(layerIndexStockach,["DEBW522AA00022dcc", "DEBW522AA0003bf3b","DEBW522AA0000976a","DEBW522AA00001d00"]); } function highlightBuildings(layerIndex, id){ var Framework = vcs.vcm.Framework.getInstance(); var layers = Framework.getLayers(); var layer = layers[layerIndex]; layer.highlight({"DEBW522AA00022dcc":Cesium.Color.fromCssColorString("#BB8FCE")}) layer.highlight({"DEBW522AA0003bf3b":Cesium.Color.fromCssColorString("#BB8FCE")}) layer.highlight({"DEBW522AA0000976a":Cesium.Color.fromCssColorString("#BB8FCE")}) layer.highlight({"DEBW522AA00001d00":Cesium.Color.fromCssColorString("#BB8FCE")}) var layerIndexRosenstein var layernameRosenstein = ["Rosenstein"] var frameworkZus = vcs.vcm.Framework.getInstance(); var layersZus = frameworkZus.getLayers(); for (var i = 0; i< layersZus.length; i++) { var layerst = layersZus[i]; if(layernameRosenstein.indexOf(layerst.getName()) >= 0) { layerIndexRosenstein = i }} layer2 = layers[layerIndexRosenstein]; var tileset = layer2.getCesium3DTileset(); if( tileset ) { tileset.style = new Cesium.Cesium3DTileStyle({ color: { conditions: [ ["true", "color('#77a1b9')"], ], }, }); } var layerIndexPart var layernamePart = ["StuttgartPart"] var frameworkPart = vcs.vcm.Framework.getInstance(); var layersPart = frameworkPart.getLayers(); for (var i = 0; i< layersPart.length; i++) { var layerPart = layersPart[i]; if(layernamePart.indexOf(layerPart.getName()) >= 0) { layerIndexPart = i }} layer3 = layersPart[layerIndexPart]; var tilesetPart = layer3.getCesium3DTileset(); if (tilesetPart) { tilesetPart.style = new Cesium.Cesium3DTileStyle({ color: { conditions: [ ["${gml_id} === 'DEBW522AA0001fd8a'", "color('#FFFFFF')"], ["${gml_id} === 'DEBW522AA00016448'", "color('#FFFFFF')"], ["true", "color('#77a1b9')"], ], }, }); } // ----------why does this not work? // for (i = 0; i < id.length - 1; i++){ // idtext = '' + id[i] // layer.highlight({idtext:Cesium.Color.fromCssColorString("#BB8FCE")}) // console.log("layer.highlight({" + idtext + ":Cesium.Color.fromCssColorString('#BB8FCE')})") // } } function unhighlightStuff() { // var layerIndexStockach // var layernameStockach = ["Stöckach"] var framework = vcs.vcm.Framework.getInstance(); var layers = framework.getLayers(); // for (var i = 0; i< layers.length; i++) { // var layersto = layers[i]; // if(layernameStockach.indexOf(layersto.getName()) >= 0) { // layerIndexStockach = i // }} // var layer = layers[layerIndexStockach]; // layer.highlight({"DEBW522AA00022dcc":Cesium.Color.fromCssColorString("#BB8FCE")}) // layer.highlight({"DEBW522AA0003bf3b":Cesium.Color.fromCssColorString("#BB8FCE")}) // layer.highlight({"DEBW522AA0000976a":Cesium.Color.fromCssColorString("#BB8FCE")}) // layer.highlight({"DEBW522AA00001d00":Cesium.Color.fromCssColorString("#BB8FCE")}) // layer.clearHighlighting(); var layerIndexRosenstein var layernameRosenstein = ["Rosenstein"] var frameworkZus = vcs.vcm.Framework.getInstance(); var layersZus = frameworkZus.getLayers(); for (var i = 0; i< layersZus.length; i++) { var layerst = layersZus[i]; if(layernameRosenstein.indexOf(layerst.getName()) >= 0) { layerIndexRosenstein = i }} layer2 = layers[layerIndexRosenstein]; // var tileset = layer2.getCesium3DTileset(); layer2.clearStyle(); var layerIndexPart var layernamePart = ["StuttgartPart"] var frameworkPart = vcs.vcm.Framework.getInstance(); var layersPart = frameworkPart.getLayers(); for (var i = 0; i< layersPart.length; i++) { var layerPart = layersPart[i]; if(layernamePart.indexOf(layerPart.getName()) >= 0) { layerIndexPart = i }} layer3 = layersPart[layerIndexPart]; // var tilesetPart = layer3.getCesium3DTileset(); layer3.clearStyle(); // tileset.style = new Cesium.Cesium3DTileStyle({ // color: { // conditions: [ // ["true", "rgb(127, 59, 8)"], // ], // }, // }); } function highlightEnergy() { var layerIndexRosenstein var layernameRosenstein = ["Rosenstein"] var frameworkZus = vcs.vcm.Framework.getInstance(); var layersZus = frameworkZus.getLayers(); for (var i = 0; i< layersZus.length; i++) { var layerst = layersZus[i]; if(layernameRosenstein.indexOf(layerst.getName()) >= 0) { layerIndexRosenstein = i }} var layer2 = layersZus[layerIndexRosenstein]; var tileset = layer2.getCesium3DTileset(); if( tileset ) { tileset.style = new Cesium.Cesium3DTileStyle({ color: { conditions: [ ["(${Specificspaceheatingdemand} > 0) && (${Specificspaceheatingdemand} < 100)", "color('#38943d')"], ["(${Specificspaceheatingdemand} >= 100) && (${Specificspaceheatingdemand} < 200)", "color('#699438')"], ["(${Specificspaceheatingdemand} >= 200) && (${Specificspaceheatingdemand} < 300)", "color('#d0d40b')"], ["(${Specificspaceheatingdemand} >= 300) && (${Specificspaceheatingdemand} < 400)", "color('#db6f09')"], ["(${Specificspaceheatingdemand} >= 400) && (${Specificspaceheatingdemand} < 500)", "color('#ad0202')"], ["true", "color('#77a1b9')"], ], }, }); } var layerIndexPart var layernamePart = ["StuttgartPart"] var frameworkPart = vcs.vcm.Framework.getInstance(); var layersPart = frameworkPart.getLayers(); for (var i = 0; i< layersPart.length; i++) { var layerPart = layersPart[i]; if(layernamePart.indexOf(layerPart.getName()) >= 0) { layerIndexPart = i }} var layer3 = layersPart[layerIndexPart]; var tilesetPart = layer3.getCesium3DTileset(); if (tilesetPart) { tilesetPart.style = new Cesium.Cesium3DTileStyle({ color: { conditions: [ ["${gml_id} === 'DEBW522AA0001fd8a'", "color('#FFFFFF')"], ["${gml_id} === 'DEBW522AA00016448'", "color('#FFFFFF')"], // ["(${citygml_measured_height} >= 1.0)", "color('#1a9641')"], //["(${Specificspaceheatingdemand } > 287.3)", "color('#000000')"], // ["(${Specific space heating demand} > 0) && (${Specific space heating demand} < 60)", "color('#33ACFF')"], // ["(${Specific space heating demand} >= 60) && (${Specific space heating demand} < 120)", "color('#2AFF00')"], // ["(${Specific space heating demand} >= 120) && (${Specific space heating demand} < 170)", "color('#FFFF00')"], // ["(${Specific space heating demand} >= 170) && (${Specific space heating demand} < 230)", "color('#FFA200')"], // ["(${Specific_space_heating_demand} >= 230)", "color('#FF0000')"] ["(${Specificspaceheatingdemand} > 70) && (${Specificspaceheatingdemand} < 100)", "color('#38943d')"], ["(${Specificspaceheatingdemand} >= 100) && (${Specificspaceheatingdemand} < 200)", "color('#699438')"], ["(${Specificspaceheatingdemand} >= 200) && (${Specificspaceheatingdemand} < 300)", "color('#d0d40b')"], ["(${Specificspaceheatingdemand} >= 300) && (${Specificspaceheatingdemand} < 400)", "color('#db6f09')"], ["(${Specificspaceheatingdemand} >= 400) && (${Specificspaceheatingdemand} < 500)", "color('#ad0202')"], ["true", "color('#77a1b9')"], ], }, }); } // ----------why does this not work? // for (i = 0; i < id.length - 1; i++){ // idtext = '' + id[i] // layer.highlight({idtext:Cesium.Color.fromCssColorString("#BB8FCE")}) // console.log("layer.highlight({" + idtext + ":Cesium.Color.fromCssColorString('#BB8FCE')})") // } }