From 0fbda5dc84c7c0ad79ec143911f522dec43a8040 Mon Sep 17 00:00:00 2001 From: prusswan Date: Tue, 21 Jan 2025 02:35:01 +0800 Subject: [PATCH] fix for Inspect to work with FileSource --- src/components/MapMaplibreGl.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/MapMaplibreGl.tsx b/src/components/MapMaplibreGl.tsx index dd17b0b4..2e591c55 100644 --- a/src/components/MapMaplibreGl.tsx +++ b/src/components/MapMaplibreGl.tsx @@ -137,8 +137,19 @@ class MapMaplibreGlInternal extends React.Component { + let layerNames = metadata.vector_layers.map((e) => e.id); + + map.style.sourceCaches["source"]._source.vectorLayerIds = layerNames; + console.log("layerNames for inspect:", layerNames); + }); + } } + } componentDidMount() {