原报错:

Uncaught RangeError: WebAssembly.Memory(): could not allocate memory

解决办法:
添加 mapInstanceRef.current 检查

 const clearCurrentOverlays = () => {
if (!mapInstanceRef.current) return;

currentOverlayRef.current.forEach(overlay => {
  mapInstanceRef.current.removeOverlay(overlay);
});
currentOverlayRef.current = [];

};

最后修改:2026 年 05 月 17 日
如果觉得我的文章对你有用,请随意赞赏