antvis / LarkMap

A React toolkit for geospatial visualization based on L7.

Home Page:https://larkmap.antv.antgroup.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐛 LayerPopup 复合图层情况

lvisei opened this issue · comments

🐛 LayerPopup 复合图层报错

https://github.com/antvis/LarkMap/blob/main/src/components/LayerPopup/index.tsx#L47

  1. 直接复合图层报错
  2. 复合多主图层情况未考虑
  3. typeof item.layer === 'string' 情况。未找到是否跳出当前循环,不 console.error,console.warn ?
map((layer) => {
    if (layer.isComposite) {
      const layers = (layer as ICompositeLayer).getInteractionSubLayers();
      return layers.map((_layer) => _layer as unknown as ILayer);
    }
    return _layer as unknown as ILayer
)