This commit is contained in:
zh
2025-09-01 16:17:11 +08:00
parent d802602200
commit 6fa99df21c
1035 changed files with 377083 additions and 1 deletions

View File

@ -0,0 +1,37 @@
function changeClassificationPrimitive(options, array) {
this.options = options
this.array = array
}
changeClassificationPrimitive.prototype.getGeometry = function () {
return Cesium.PolygonGeometry.createGeometry(this.options);
};
changeClassificationPrimitive.prototype.update = function (context, frameState, commandList) {
var geometry = this.getGeometry();
if (!geometry) {
return;
}
this._primitive = new Cesium.ClassificationPrimitive({
geometryInstances: new Cesium.GeometryInstance({
geometry: geometry,
id: {
type: 'dth',
...this.array,
},
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(
Cesium.Color.fromRandom({ alpha: 0.5 })
),
show: new Cesium.ShowGeometryInstanceAttribute(true),
}
}),
classificationType: Cesium.ClassificationType.CESIUM_3D_TILE,
});
var primitive = this._primitive
primitive.update(context, frameState, commandList);
};
export { changeClassificationPrimitive }