优化渲染帧率

This commit is contained in:
2024-01-25 14:14:48 +08:00
parent bfd0d631b7
commit 67ef2f01ec

View File

@@ -2413,16 +2413,21 @@ const onDataSourceReady = ({ viewer, cesiumObject }) => {
setTimeout(() => {
let mypolylines;
viewer.scene.primitives._primitives.forEach((element, index) => {
if (element.constructor.name == "CustomPolyline") {
viewer.scene.primitives._primitives.splice(index, 2);
}
if (element.constructor.name == "PolylineCollection") {
if (element._mode == 2) {
element._mode = 1;
}
mypolylines = element;
}
if (element.constructor.name == "CustomPolyline") {
viewer.scene.primitives._primitives.splice(index, 1);
// 打包后进行系统切换后对象名称发生改变 CustomPolyline --> xe
if(element.constructor.name == "xe"){
viewer.scene.primitives._primitives.splice(index, 2);
}
if (element.mymark) {
// 打包后系统切换后对象名称发生改变 PolylineCollection --> Ie
if (element.constructor.name == "Ie") {
viewer.scene.primitives._primitives.splice(index, 1);
}
});