antvis/LarkMap

🐛 [BUG]

ThorSmallice opened this issue · 1 comments

https://codesandbox.io/embed/cocky-gould-3hwt54?fontsize=14&hidenavigation=1&theme=dark

<LarkMap {...config} style={{ height: "100vh" }}>
<IconImageLayer id="IconImageLayer" name="信访点" {...options} source={source} />
<LayerSwitchControl
layers={['IconImageLayer']}
position="bottomleft"
popperPlacement="right-end"
/>

只用了一个LayerSwitchControl组件 ,地图上却显示了两个图层控制按钮
image

"@antv/l7": "^2.15.3",
"@antv/larkmap": "^1.3.5",

lvisei commented

StrictMode 下父组件挂载两次导致

image

control useState 改 ref ?? cc @heiyexing

image