代码迁移

This commit is contained in:
zh
2025-07-03 13:54:01 +08:00
parent b04de8a084
commit 2a4da33e62
985 changed files with 358292 additions and 13 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 }