mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-11-29 18:58:26 +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) => {
|
||||
if (map.current) {
|
||||
map.current.setCenter(position);
|
||||
map.current.setZoom(zoom);
|
||||
if (map.current && position) {
|
||||
map.current?.setCenter(position);
|
||||
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 = () => {
|
||||
@ -386,7 +386,6 @@ export const GoogleMapsComponent = React.forwardRef<GoogleMapForwardedRefProps,
|
||||
});
|
||||
});
|
||||
const app = useApp();
|
||||
|
||||
if (!accessKey || errMessage) {
|
||||
return (
|
||||
<Alert
|
||||
|
@ -34,6 +34,10 @@ export const getCurrentPosition: () => Promise<{ lat: number; lng: number }> = (
|
||||
() => {
|
||||
defaultLatLng();
|
||||
},
|
||||
{
|
||||
timeout: 2000, // 设置最大等待时间,单位毫秒
|
||||
maximumAge: 0, // 不使用缓存的地理位置
|
||||
},
|
||||
);
|
||||
} else {
|
||||
defaultLatLng();
|
||||
|
Loading…
Reference in New Issue
Block a user