fix: aMap repeat load issure fixed (#5490)

* fix: 修复Amap多次load导致报错的问题

* feat: branch restore

* fix: aMap repeat load issure fixed

* fix: aMap repeat load issure fixed

* Delete packages/plugins/@nocobase/plugin-calendar/src/locale/zh-CN.ts
This commit is contained in:
chenyongxin 2024-10-24 16:09:59 +08:00 committed by GitHub
parent e85e131ea8
commit 3fa93ccf36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 3 deletions

View File

@ -2,9 +2,7 @@
"version": "1.3.39-beta", "version": "1.3.39-beta",
"npmClient": "yarn", "npmClient": "yarn",
"useWorkspaces": true, "useWorkspaces": true,
"npmClientArgs": [ "npmClientArgs": ["--ignore-engines"],
"--ignore-engines"
],
"command": { "command": {
"version": { "version": {
"forcePublish": true, "forcePublish": true,

View File

@ -335,6 +335,24 @@ export const AMapComponent = React.forwardRef<AMapForwardedRefProps, AMapCompone
const _define = (window as any).define; const _define = (window as any).define;
(window as any).define = undefined; (window as any).define = undefined;
if (window.AMap) {
try {
requestIdleCallback(() => {
map.current = new AMap.Map(id.current, {
resizeEnable: true,
zoom,
} as AMap.MapOptions);
aMap.current = AMap;
setErrMessage('');
forceUpdate([]);
});
return;
} catch (err) {
setErrMessage(err);
}
}
AMapLoader.load({ AMapLoader.load({
key: accessKey, key: accessKey,
version: '2.0', version: '2.0',