diff options
Diffstat (limited to 'modern/src/map/main/MapSelectedDevice.js')
-rw-r--r-- | modern/src/map/main/MapSelectedDevice.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/map/main/MapSelectedDevice.js b/modern/src/map/main/MapSelectedDevice.js index 9d97dd75..c52b8df0 100644 --- a/modern/src/map/main/MapSelectedDevice.js +++ b/modern/src/map/main/MapSelectedDevice.js @@ -5,11 +5,14 @@ import dimensions from '../../common/theme/dimensions'; import { map } from '../core/MapView'; import { usePrevious } from '../../reactHelper'; import usePersistedState from '../../common/util/usePersistedState'; +import { useAttributePreference } from '../../common/util/preferences'; const MapSelectedDevice = () => { const selectedDeviceId = useSelector((state) => state.devices.selectedId); const previousDeviceId = usePrevious(selectedDeviceId); + const selectZoom = useAttributePreference('web.selectZoom', 10); + const position = useSelector((state) => state.positions.items[selectedDeviceId]); const [mapFollow] = usePersistedState('mapFollow', false); @@ -18,7 +21,7 @@ const MapSelectedDevice = () => { if ((selectedDeviceId !== previousDeviceId || mapFollow) && position) { map.easeTo({ center: [position.longitude, position.latitude], - zoom: Math.max(map.getZoom(), 10), + zoom: Math.max(map.getZoom(), selectZoom), offset: [0, -dimensions.popupMapOffset / 2], }); } |