aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-28 13:52:49 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-28 13:52:49 -0700
commitdd09b5c7ed235088d86ba9898261d74228b825ee (patch)
treea0992db59b7c4d5606ef5327a2692c57ead883e7 /modern/src/map
parentfac80024e0956d543b762296e0ee49cd72035b93 (diff)
downloadtrackermap-web-dd09b5c7ed235088d86ba9898261d74228b825ee.tar.gz
trackermap-web-dd09b5c7ed235088d86ba9898261d74228b825ee.tar.bz2
trackermap-web-dd09b5c7ed235088d86ba9898261d74228b825ee.zip
Support default map (fix #1002)
Diffstat (limited to 'modern/src/map')
-rw-r--r--modern/src/map/core/MapView.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/map/core/MapView.js b/modern/src/map/core/MapView.js
index 7ed5eae6..2c49b8ba 100644
--- a/modern/src/map/core/MapView.js
+++ b/modern/src/map/core/MapView.js
@@ -4,7 +4,7 @@ import React, {
useRef, useLayoutEffect, useEffect, useState,
} from 'react';
import { SwitcherControl } from '../switcher/switcher';
-import { useAttributePreference } from '../../common/util/preferences';
+import { useAttributePreference, usePreference } from '../../common/util/preferences';
import usePersistedState, { savePersistedState } from '../../common/util/usePersistedState';
import { mapImages } from './preloadImages';
import useMapStyles from './useMapStyles';
@@ -76,7 +76,7 @@ const MapView = ({ children }) => {
const mapStyles = useMapStyles();
const activeMapStyles = useAttributePreference('activeMapStyles', 'locationIqStreets,osm,carto');
- const [defaultMapStyle] = usePersistedState('selectedMapStyle', 'locationIqStreets');
+ const [defaultMapStyle] = usePersistedState('selectedMapStyle', usePreference('map', 'locationIqStreets'));
const mapboxAccessToken = useAttributePreference('mapboxAccessToken');
const maxZoom = useAttributePreference('web.maxZoom');