aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-01 15:59:08 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-01 15:59:08 -0700
commit7051969d15be15b73ec8af52cdcd8f51d7de058b (patch)
tree5f11fa7e2f6609af396e1ebbf338d6eea70fdda9 /modern
parentdda2a188f86b5e11237e02074f91b3361543cff0 (diff)
downloadtrackermap-web-7051969d15be15b73ec8af52cdcd8f51d7de058b.tar.gz
trackermap-web-7051969d15be15b73ec8af52cdcd8f51d7de058b.tar.bz2
trackermap-web-7051969d15be15b73ec8af52cdcd8f51d7de058b.zip
Add map popup offset
Diffstat (limited to 'modern')
-rw-r--r--modern/src/map/SelectedDeviceMap.js6
-rw-r--r--modern/src/theme/dimensions.js1
2 files changed, 6 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]);
diff --git a/modern/src/theme/dimensions.js b/modern/src/theme/dimensions.js
index e852f0b4..c2d60bb5 100644
--- a/modern/src/theme/dimensions.js
+++ b/modern/src/theme/dimensions.js
@@ -10,4 +10,5 @@ export default {
columnWidthNumber: 130,
columnWidthString: 160,
columnWidthBoolean: 130,
+ popupMapOffset: 300,
};