优化代码消除 控制台的报错信息

This commit is contained in:
mmc
2026-08-31 10:30:21 +08:00
parent 674721504d
commit a1922cdeaf
23 changed files with 259 additions and 214 deletions

View File

@@ -651,9 +651,9 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
const layerIdentifier = `${workspace}:${layerName}`;
let baseUrl = wmsUrl;
const cesiumLayers = [];
if (index == 2 && from == "other") {
flyToLayer(layerIdentifier, baseUrl, 100);
}
//if (index == 2 && from == "other") {
// //flyToLayer(layerIdentifier, baseUrl, 100);
//}
//if (index == 0 && from == "other") {
// flyToLayer(layerIdentifier, baseUrl, 100);
//}
@@ -1246,8 +1246,17 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
if (viewer) {
if (planLineRef.current) {
viewer.entities.remove(planLineRef.current);
planLineRef.current = null;
}
if (polygonRef.current) {
viewer.entities.remove(polygonRef.current);
polygonRef.current = null;
}
viewer.scene.requestRender();
}
prevIfClearPlanLine.current = ifClearPlanLine;