From 8e7210a206f8d730e1c381143a5542493d702b4b Mon Sep 17 00:00:00 2001 From: Dunqing Date: Fri, 16 Dec 2022 18:29:41 +0800 Subject: [PATCH] feat: support sync button (#1258) --- .../map/src/client/components/AMap.tsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/plugins/map/src/client/components/AMap.tsx b/packages/plugins/map/src/client/components/AMap.tsx index 91d83ac1d..a06220b40 100644 --- a/packages/plugins/map/src/client/components/AMap.tsx +++ b/packages/plugins/map/src/client/components/AMap.tsx @@ -11,6 +11,7 @@ import Search from './Search'; import { useMemoizedFn } from 'ahooks'; import { useMapConfiguration } from '../hooks'; import { useHistory } from 'react-router'; +import { SyncOutlined } from '@ant-design/icons'; interface AMapComponentProps { accessKey: string; @@ -177,6 +178,12 @@ const AMapComponent: React.FC = (props) => { }); }; + const onFocusOverlay = () => { + if (overlay.current) { + map.current.setFitView([overlay.current]); + } + }; + // 编辑时 useEffect(() => { if (!aMap.current) return; @@ -301,6 +308,24 @@ const AMapComponent: React.FC = (props) => { height: '500px', }} > + {/* bottom: 20px; right: 50%; transform: translateX(50%); z-index: 2; */} +
+ +
{!disabled ? ( <> @@ -330,6 +355,7 @@ const AMapComponent: React.FC = (props) => { }} onClick={onReset} type="primary" + danger > {t('Clear')}