优化渲染帧率

main
qubiaobiao 2024-01-25 14:14:48 +08:00
parent bfd0d631b7
commit 67ef2f01ec
1 changed files with 8 additions and 3 deletions

View File

@ -2413,16 +2413,21 @@ const onDataSourceReady = ({ viewer, cesiumObject }) => {
setTimeout(() => { setTimeout(() => {
let mypolylines; let mypolylines;
viewer.scene.primitives._primitives.forEach((element, index) => { 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.constructor.name == "PolylineCollection") {
if (element._mode == 2) { if (element._mode == 2) {
element._mode = 1; element._mode = 1;
} }
mypolylines = element; mypolylines = element;
} }
if (element.constructor.name == "CustomPolyline") { // CustomPolyline --> xe
viewer.scene.primitives._primitives.splice(index, 1); 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); viewer.scene.primitives._primitives.splice(index, 1);
} }
}); });