1. A concise explanation of the problem you’re experiencing.
Hı all ,
I described the function of adding a radio buton 3d tile building. I want the color of the building to change with another button. But compared with some problems.
the color change function does not work if you do as in the first code.
firts code ==>
var scene = viewer.scene;
function Lod1Add(ar){
if (ar === 'a') {
var lod1 = new Cesium.Cesium3DTileset({
url : '03_data/lod1',
skipLevelOfDetail : true,
maximumScreenSpaceError : 24
});
var myPrimitive = lod1;
scene.primitives.add(myPrimitive);
}
else if(ar === 'r'){
scene.primitives.removeAll();
}
}
function Color(){
var colorAdd= new Cesium.Cesium3DTileStyle({
color : “rgb(255,0,218)” ,
show : true
});
scene.primitives.add(myPrimitive).style = colorAdd;
}
``
in the second code ; buildings are displayed only once . It does not come up when I try to add buildings for the second time.
Second Code ==>
var scene = viewer.scene;
var lod1 = new Cesium.Cesium3DTileset({
url : ‘03_data/lod1’,
skipLevelOfDetail : true,
maximumScreenSpaceError : 24
});
var myPrimitive = lod1;
function Lod1Add(ar){
if (ar === 'a') {
scene.primitives.add(myPrimitive);
}
else if(ar === 'r'){
scene.primitives.removeAll();
}
}
function Color(){
var colorAdd= new Cesium.Cesium3DTileStyle({
color : “rgb(255,0,218)” ,
show : true
});
scene.primitives.add(myPrimitive).style = colorAdd;
}
``
How can I add or remove buildings to change their colors.?
Thank you.
4. The Cesium version you’re using, your operating system and browser.
Cesium 1.39