Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] 图层切换显示组件有问题 #191

Open
haobarry opened this issue Sep 28, 2023 · 2 comments
Open

🐛 [BUG] 图层切换显示组件有问题 #191

haobarry opened this issue Sep 28, 2023 · 2 comments

Comments

@haobarry
Copy link

haobarry commented Sep 28, 2023

我增加了两个图层 控制台报错信息
图片

Warning: Cannot update a component (`LayerSwitchControl2`) while rendering a different component (`ForwardRef(BubbleLayer3)`). To locate the bad setState() call inside `ForwardRef(BubbleLayer3)`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render
BubbleLayer3@http://127.0.0.1:5173/node_modules/.vite/deps/@antv_larkmap.js?v=505fd349:28947:32
AreaMarkLayer@http://127.0.0.1:5173/src/map-features/AreaMarkLayer.tsx:23:39
div
LarkMap2@http://127.0.0.1:5173/node_modules/.vite/deps/@antv_larkmap.js?v=505fd349:23306:12
GaoDeMapInstance@http://127.0.0.1:5173/src/GaoDeMapInstance.tsx?t=1695886767663:48:39
App@http://127.0.0.1:5173/src/App.tsx?t=1695886189350:23:37 react-dom.development.js:86:29
    React 5
    onUpdateLayerList2 index.js:18
    doEmit index.ts:69
    emit index.ts:73
    addLayer layer-manager.js:66
    useCreateLayer2 index.js:45
    BubbleLayer3 index.js:10
    React 8
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533
    (异步:EventHandlerNonNull)
    js scheduler.development.js:571
    js scheduler.development.js:633
    __require chunk-ROME4SDB.js:11
    js index.js:6
    __require chunk-ROME4SDB.js:11
    React 2
    __require chunk-ROME4SDB.js:11
    js React
    __require chunk-ROME4SDB.js:11
    js React
    __require chunk-ROME4SDB.js:11
    <anonymous> react-dom_client.js:38

右上角只能显示一个图层,不能切换双图层

图片

  • LarkMap Version: 最新版
  • Platform: react 18
@lvisei
Copy link
Member

lvisei commented Sep 28, 2023

复现一下问题 https://codesandbox.io/s/n7rj3m?file=/App.tsx

@haobarry
Copy link
Author

复现一下问题 https://codesandbox.io/s/n7rj3m?file=/App.tsx

好的, 可是我最近没时间弄, 下次我有问题再来。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants