现在有一个需求,就是一个多边形范围会发生变化(不规则),请问如何在变化前和变化后进行平滑过渡(动画效果),而不是在场景中简单移除掉变化前的,然后再加入变化后的。
if (_customPrimtiveCollection != null) {
window.CesiumViewer.scene.primitives.remove(_customPrimtiveCollection);
_customPrimtiveCollection = new window.Cesium.PrimitiveCollection;
window.CesiumViewer.scene.primitives.add(_customPrimtiveCollection);
}
window.CesiumViewer.entities.removeAll();
let instances = [];
for (var polygonKey of Object.keys(unions)) {
let poly = [];
for (var point of unions[polygonKey]) {
poly.push(point.x, point.y, point.z);
}
var instance = new Cesium.GeometryInstance({
geometry: new Cesium.PolygonGeometry({
polygonHierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(poly)),
extrudedHeight: 0,
perPositionHeight: true
}),
id: polygonKey
});
instances.push(instance);
}
let myPrimitive = new Cesium.Primitive({
geometryInstances: instances,
appearance: appearance,
asynchronous: false
});
_customPrimtiveCollection.add(myPrimitive);