mirror of
https://github.com/traccar/traccar-web.git
synced 2025-01-07 03:26:42 +08:00
Change default map
This commit is contained in:
parent
10577b3b0c
commit
45afb3fe18
@ -80,8 +80,8 @@ const MapView = ({ children }) => {
|
||||
const [mapReady, setMapReady] = useState(false);
|
||||
|
||||
const mapStyles = useMapStyles();
|
||||
const activeMapStyles = useAttributePreference('activeMapStyles', 'openFreeMap,locationIqStreets,locationIqDark');
|
||||
const [defaultMapStyle] = usePersistedState('selectedMapStyle', usePreference('map', 'openFreeMap'));
|
||||
const activeMapStyles = useAttributePreference('activeMapStyles', 'locationIqStreets,locationIqDark,openFreeMap');
|
||||
const [defaultMapStyle] = usePersistedState('selectedMapStyle', usePreference('map', 'locationIqStreets'));
|
||||
const mapboxAccessToken = useAttributePreference('mapboxAccessToken');
|
||||
const maxZoom = useAttributePreference('web.maxZoom');
|
||||
|
||||
|
@ -108,7 +108,7 @@ const PreferencesPage = () => {
|
||||
<InputLabel>{t('mapActive')}</InputLabel>
|
||||
<Select
|
||||
label={t('mapActive')}
|
||||
value={attributes.activeMapStyles?.split(',') || ['openFreeMap', 'locationIqStreets', 'locationIqDark']}
|
||||
value={attributes.activeMapStyles?.split(',') || ['locationIqStreets', 'locationIqDark', 'openFreeMap']}
|
||||
onChange={(e, child) => {
|
||||
const clicked = mapStyles.find((s) => s.id === child.props.value);
|
||||
if (clicked.available) {
|
||||
|
@ -102,7 +102,7 @@ const ServerPage = () => {
|
||||
<InputLabel>{t('mapDefault')}</InputLabel>
|
||||
<Select
|
||||
label={t('mapDefault')}
|
||||
value={item.map || 'openFreeMap'}
|
||||
value={item.map || 'locationIqStreets'}
|
||||
onChange={(e) => setItem({ ...item, map: e.target.value })}
|
||||
>
|
||||
{mapStyles.filter((style) => style.available).map((style) => (
|
||||
|
@ -187,7 +187,7 @@ const UserPage = () => {
|
||||
<InputLabel>{t('mapDefault')}</InputLabel>
|
||||
<Select
|
||||
label={t('mapDefault')}
|
||||
value={item.map || 'openFreeMap'}
|
||||
value={item.map || 'locationIqStreets'}
|
||||
onChange={(e) => setItem({ ...item, map: e.target.value })}
|
||||
>
|
||||
{mapStyles.filter((style) => style.available).map((style) => (
|
||||
|
Loading…
Reference in New Issue
Block a user