support custom map tile server url

This commit is contained in:
MaysWind
2023-10-29 00:31:56 +08:00
parent acc9bf77fb
commit f673677c2a
8 changed files with 102 additions and 23 deletions
+19
View File
@@ -53,6 +53,25 @@ export function isMapDataFetchProxyEnabled() {
return getServerSetting('mp') === '1';
}
export function getCustomMapTileServerUrl() {
return getServerDecodedSetting('cmsu');
}
export function getCustomMapMinZoomLevel() {
const zoomLevelSettings = (getServerSetting('cmzl') || '').split('-');
return (zoomLevelSettings && zoomLevelSettings[0]) ? parseInt(zoomLevelSettings[0]) : 1;
}
export function getCustomMapMaxZoomLevel() {
const zoomLevelSettings = (getServerSetting('cmzl') || '').split('-');
return (zoomLevelSettings && zoomLevelSettings[1]) ? parseInt(zoomLevelSettings[1]) : 18;
}
export function getCustomMapDefaultZoomLevel() {
const zoomLevelSettings = (getServerSetting('cmzl') || '').split('-');
return (zoomLevelSettings && zoomLevelSettings[2]) ? parseInt(zoomLevelSettings[2]) : 14;
}
export function getTomTomMapAPIKey() {
return getServerDecodedSetting('tmak');
}