Hello all,
I created an entity by way of CZML. Now I would like to remove it.
A simple example for Sandcastle:
HTML
<style>
@import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar"></div>
JAVASCRIPT
var czml1 = [{
"id" : "document",
"name" : "CZML Geometries: Rectangle",
"version" : "1.0"
}, {
"id":"1",
"rectangle" : {
"coordinates" : {
"wsenDegrees" : [-120, 40, -110, 50]
},
"fill" : true,
"material" : {
"solidColor" : {
"color": {
"rgba" : [255, 0, 0, 255]
}
}
}
}
}, {
"id":"2",
"rectangle" : {
"coordinates" : {
"wsenDegrees" : [-110, 40, -100, 50]
},
"fill" : true,
"material" : {
"solidColor" : {
"color": {
"rgba" : [0, 0, 255, 255]
}
}
}
}
}];
var viewer = new Cesium.Viewer('cesiumContainer');
var promise1 = Cesium.CzmlDataSource.load(czml1);
viewer.dataSources.add(promise1);
Sandcastle.addToolbarButton('remove entity 1', function() {
viewer.entities.removeById("1");
});
I have hundreds of CZML entities and I would like to change (add,remove,update) the entity's positions, transformations, etc.. To accomplish this, I believe I must delete the entity entirely and recreate it from the database.
Many thanks as usual, erik