mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +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",
|
"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,
|
||||||
|
@ -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',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user