aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/ServerPage.js
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/settings/ServerPage.js
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/settings/ServerPage.js')
-rw-r--r--modern/src/settings/ServerPage.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/modern/src/settings/ServerPage.js b/modern/src/settings/ServerPage.js
index e51c002c..dccb52c6 100644
--- a/modern/src/settings/ServerPage.js
+++ b/modern/src/settings/ServerPage.js
@@ -30,6 +30,7 @@ import useCommonDeviceAttributes from '../common/attributes/useCommonDeviceAttri
import useCommonUserAttributes from '../common/attributes/useCommonUserAttributes';
import { useCatch } from '../reactHelper';
import useServerAttributes from '../common/attributes/useServerAttributes';
+import useMapStyles from '../map/core/useMapStyles';
const useStyles = makeStyles((theme) => ({
container: {
@@ -58,6 +59,7 @@ const ServerPage = () => {
const dispatch = useDispatch();
const t = useTranslation();
+ const mapStyles = useMapStyles();
const commonUserAttributes = useCommonUserAttributes(t);
const commonDeviceAttributes = useCommonDeviceAttributes(t);
const serverAttributes = useServerAttributes(t);
@@ -102,6 +104,20 @@ const ServerPage = () => {
onChange={(event) => setItem({ ...item, overlayUrl: event.target.value })}
label={t('mapOverlayCustom')}
/>
+ <FormControl>
+ <InputLabel>{t('mapDefault')}</InputLabel>
+ <Select
+ label={t('mapDefault')}
+ value={item.map || 'locationIqStreets'}
+ onChange={(e) => setItem({ ...item, map: e.target.value })}
+ >
+ {mapStyles.filter((style) => style.available).map((style) => (
+ <MenuItem key={style.id} value={style.id}>
+ <Typography component="span">{style.title}</Typography>
+ </MenuItem>
+ ))}
+ </Select>
+ </FormControl>
<TextField
type="number"
value={item.latitude || 0}