react-amap icon indicating copy to clipboard operation
react-amap copied to clipboard

频繁加载卸载地图可能造成内存泄漏导致浏览器崩溃问题。

Open jaywcjlove opened this issue 3 years ago • 4 comments

image

这个问题看上去可能是 SDK 本身造成的。

https://github.com/uiwjs/react-amap/blob/c03cc48c8cee634e907fba62f0ee4597d8658013/packages/map/src/useMap.tsx#L48-L51

通过使用 iframe 刷新理论上可以解决这种问题。

jaywcjlove avatar Mar 01 '22 08:03 jaywcjlove

https://codesandbox.io/embed/uiwjs-react-amap-issues-213-itoscq?fontsize=14&hidenavigation=1&theme=dark

在 iframe 中使用

image

jaywcjlove avatar Mar 01 '22 09:03 jaywcjlove

image

jaywcjlove avatar Mar 03 '22 09:03 jaywcjlove

官方已经回复:将地图版本提升到 2.0.5 有明显改善

gonganruyi avatar Apr 21 '22 03:04 gonganruyi

@gonganruyi 示例:https://codesandbox.io/embed/uiwjs-uiw-issues-717-ig91j7?fontsize=14&hidenavigation=1&theme=dark

<APILoader version="2.0.5" akay="a7a90e05a37d3f6bf76d4a9032fc9129">
  <Demo />
</APILoader>

jaywcjlove avatar Apr 21 '22 05:04 jaywcjlove