mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
8541da4218
@ -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