mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-01 19:58:15 +08:00
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:
parent
e85e131ea8
commit
3fa93ccf36
@ -2,9 +2,7 @@
|
||||
"version": "1.3.39-beta",
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"npmClientArgs": [
|
||||
"--ignore-engines"
|
||||
],
|
||||
"npmClientArgs": ["--ignore-engines"],
|
||||
"command": {
|
||||
"version": {
|
||||
"forcePublish": true,
|
||||
|
@ -335,6 +335,24 @@ export const AMapComponent = React.forwardRef<AMapForwardedRefProps, AMapCompone
|
||||
|
||||
const _define = (window as any).define;
|
||||
(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({
|
||||
key: accessKey,
|
||||
version: '2.0',
|
||||
|
Loading…
Reference in New Issue
Block a user