优化代码消除 控制台的报错信息
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user