From 7ec40f56f1d5686bff9872ff1a81ff7dd856a15f Mon Sep 17 00:00:00 2001 From: lby Date: Fri, 7 Jul 2023 12:12:27 +0800 Subject: [PATCH] fix(web): unexpect select undefined when select mvt layer (#560) Co-authored-by: keiya sasaki --- web/src/beta/lib/core/engines/Cesium/hooks.ts | 3 ++- web/src/classic/components/organisms/Published/core/hooks.ts | 2 +- web/src/classic/core/engines/Cesium/hooks.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/beta/lib/core/engines/Cesium/hooks.ts b/web/src/beta/lib/core/engines/Cesium/hooks.ts index 2fb0c5db4f..7d36b837d0 100644 --- a/web/src/beta/lib/core/engines/Cesium/hooks.ts +++ b/web/src/beta/lib/core/engines/Cesium/hooks.ts @@ -315,9 +315,10 @@ export default ({ if (prevSelectedEntity.current === entity) return; prevSelectedEntity.current = entity; + // TODO: Support layers.selectFeature API for MVT if (!entity && selectedLayerId?.featureId) { // Find ImageryLayerFeature - const ImageryLayerDataTypes: DataType[] = ["mvt"]; + const ImageryLayerDataTypes: DataType[] = []; const layers = layersRef?.current?.findAll( layer => layer.type === "simple" && diff --git a/web/src/classic/components/organisms/Published/core/hooks.ts b/web/src/classic/components/organisms/Published/core/hooks.ts index 131401f3dd..0e147b47f7 100644 --- a/web/src/classic/components/organisms/Published/core/hooks.ts +++ b/web/src/classic/components/organisms/Published/core/hooks.ts @@ -55,7 +55,7 @@ export default (alias?: string) => { const layers = useMemo(() => { return [ convertLegacyLayer({ - id: "", + id: "rootlayer", children: data?.layers?.map(l => processLayer(l)).filter((l): l is Layer => !!l), }), ].filter((l): l is Layer => !!l); diff --git a/web/src/classic/core/engines/Cesium/hooks.ts b/web/src/classic/core/engines/Cesium/hooks.ts index 713810c738..19d75ad9ec 100644 --- a/web/src/classic/core/engines/Cesium/hooks.ts +++ b/web/src/classic/core/engines/Cesium/hooks.ts @@ -232,7 +232,7 @@ export default ({ if (!entity && selectedLayerId?.featureId) { // Find ImageryLayerFeature - const ImageryLayerDataTypes: DataType[] = ["mvt"]; + const ImageryLayerDataTypes: DataType[] = []; const layers = layersRef?.current?.findAll( layer => layer.type === "simple" &&