diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-01 15:59:08 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-01 15:59:08 -0700 |
commit | 7051969d15be15b73ec8af52cdcd8f51d7de058b (patch) | |
tree | 5f11fa7e2f6609af396e1ebbf338d6eea70fdda9 /modern/src/map/SelectedDeviceMap.js | |
parent | dda2a188f86b5e11237e02074f91b3361543cff0 (diff) | |
download | trackermap-web-7051969d15be15b73ec8af52cdcd8f51d7de058b.tar.gz trackermap-web-7051969d15be15b73ec8af52cdcd8f51d7de058b.tar.bz2 trackermap-web-7051969d15be15b73ec8af52cdcd8f51d7de058b.zip |
Add map popup offset
Diffstat (limited to 'modern/src/map/SelectedDeviceMap.js')
-rw-r--r-- | modern/src/map/SelectedDeviceMap.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modern/src/map/SelectedDeviceMap.js b/modern/src/map/SelectedDeviceMap.js index 63847176..c46ea40e 100644 --- a/modern/src/map/SelectedDeviceMap.js +++ b/modern/src/map/SelectedDeviceMap.js @@ -1,6 +1,7 @@ import { useEffect } from 'react'; import { useSelector } from 'react-redux'; +import dimensions from '../theme/dimensions'; import { map } from './Map'; const SelectedDeviceMap = () => { @@ -16,7 +17,10 @@ const SelectedDeviceMap = () => { useEffect(() => { if (mapCenter) { - map.easeTo({ center: mapCenter.position }); + map.easeTo({ + center: mapCenter.position, + offset: [0, -dimensions.popupMapOffset / 2], + }); } }, [mapCenter]); |