mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
9d3e3bd010
@ -164,9 +164,9 @@ export const GoogleMapsComponent = React.forwardRef<GoogleMapForwardedRefProps,
|
|||||||
});
|
});
|
||||||
|
|
||||||
const toCenter = useMemoizedFn((position) => {
|
const toCenter = useMemoizedFn((position) => {
|
||||||
if (map.current) {
|
if (map.current && position) {
|
||||||
map.current.setCenter(position);
|
map.current?.setCenter(position);
|
||||||
map.current.setZoom(zoom);
|
map.current?.setZoom(zoom);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ export const GoogleMapsComponent = React.forwardRef<GoogleMapForwardedRefProps,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
map.current.setCenter(bounds.getCenter());
|
map.current?.setCenter?.(bounds.getCenter());
|
||||||
});
|
});
|
||||||
|
|
||||||
const onFocusOverlay = () => {
|
const onFocusOverlay = () => {
|
||||||
@ -386,7 +386,6 @@ export const GoogleMapsComponent = React.forwardRef<GoogleMapForwardedRefProps,
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
const app = useApp();
|
const app = useApp();
|
||||||
|
|
||||||
if (!accessKey || errMessage) {
|
if (!accessKey || errMessage) {
|
||||||
return (
|
return (
|
||||||
<Alert
|
<Alert
|
||||||
|
@ -34,6 +34,10 @@ export const getCurrentPosition: () => Promise<{ lat: number; lng: number }> = (
|
|||||||
() => {
|
() => {
|
||||||
defaultLatLng();
|
defaultLatLng();
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
timeout: 2000, // 设置最大等待时间,单位毫秒
|
||||||
|
maximumAge: 0, // 不使用缓存的地理位置
|
||||||
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
defaultLatLng();
|
defaultLatLng();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user