Merge branch 'fix-map-defaults' into 'master'

Fix map defaults

See merge request gridtracker.org/gridtracker!232

If this is changing anything in the UI or operational behavior, please prepare to update the wiki!
merge-requests/201/merge
T Loomis 2022-10-15 18:16:43 +00:00
commit e040fc7645
2 zmienionych plików z 38 dodań i 98 usunięć

Wyświetl plik

@ -3,151 +3,128 @@
"url": "http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"attributions": "<a href=\"http://openstreetmap.org/\" target=\"_blank\">OpenStreetMap</a>",
"minZoom": 0,
"maxZoom": 19,
"oldIndex": 0
"maxZoom": 19
},
"Mapnik by OpenStreetMap (Deutsche)": {
"url": "http://{a-c}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png",
"attributions": "<a href=\"http://openstreetmap.de/\" target=\"_blank\">OpenStreetMap Deutschland</a>",
"minZoom": 0,
"maxZoom": 18,
"oldIndex": 1
"maxZoom": 18
},
"Mapnik by OpenStreetMap (français)": {
"url": "http://{a-c}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png",
"attributions": "<a href=\"http://openstreetmap.fr/\" target=\"_blank\">OpenStreetMap France</a>",
"minZoom": 0,
"maxZoom": 18,
"oldIndex": 2
"maxZoom": 18
},
"Terrain by Stamen (English)": {
"url": "http://stamen-tiles-{a-d}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png",
"attributions": "<a target=\"_blank\" href=\"http://stamen.com\">Stamen Design</a>",
"minZoom": 0,
"maxZoom": 18,
"oldIndex": 3
"maxZoom": 18
},
"Terrain by Stamen (No Labels)": {
"url": "http://stamen-tiles-{a-d}.a.ssl.fastly.net/terrain-background/{z}/{x}/{y}.png",
"attributions": "<a target=\"_blank\" href=\"http://stamen.com\">Stamen Design</a>",
"minZoom": 0,
"maxZoom": 18,
"oldIndex": 4
"maxZoom": 18
},
"Toner by Stamen (English)": {
"url": "http://stamen-tiles-{a-d}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png",
"attributions": "<a target=\"_blank\" href=\"http://stamen.com\">Stamen Design</a>",
"minZoom": 0,
"maxZoom": 20,
"oldIndex": 5
"maxZoom": 20
},
"Toner by Stamen (No Labels)": {
"url": "http://stamen-tiles-{a-d}.a.ssl.fastly.net/toner-background/{z}/{x}/{y}.png",
"attributions": "<a target=\"_blank\" href=\"http://stamen.com\">Stamen Design</a>",
"minZoom": 0,
"maxZoom": 20,
"oldIndex": 6
"maxZoom": 20
},
"TonerLite by Stamen (English)": {
"url": "http://stamen-tiles-{a-d}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png",
"attributions": "<a target=\"_blank\" href=\"http://stamen.com\">Stamen Design</a>",
"minZoom": 0,
"maxZoom": 20,
"oldIndex": 7
"maxZoom": 20
},
"Toner by Stamen (No Labels)(Offline)": {
"url": "/map/toner-background/{z}/{x}/{y}.png",
"attributions": "Stamen Design",
"minZoom": 0,
"maxZoom": 5,
"offline": true,
"oldIndex": 8
"offline": true
},
"National Geographic by Esri (English)": {
"url": "http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",
"attributions": "&copy; Esri &mdash; National Geographic",
"maxZoom": 16,
"oldIndex": 11
"maxZoom": 16
},
"Street by Esri (English)": {
"url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",
"attributions": "&copy; Esri",
"oldIndex": 12
"attributions": "&copy; Esri"
},
"Topographical by Esri (English)": {
"url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",
"attributions": "&copy; Esri",
"oldIndex": 13
"attributions": "&copy; Esri"
},
"Physical by Esri (No Labels)": {
"url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}",
"attributions": "&copy; Esri",
"maxZoom": 8,
"oldIndex": 14
"maxZoom": 8
},
"Satellite by Esri (No Labels)": {
"url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
"attributions": "&copy; Esri",
"maxZoom": 18,
"oldIndex": 15
"maxZoom": 18
},
"Wikimedia (Intl)": {
"url": "http://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png",
"attributions": "<a target=\"_blank\" href=\"https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\">Wikimedia</a>",
"minZoom": 1,
"maxZoom": 19,
"oldIndex": 16
"maxZoom": 19
},
"Wikimedia (No Labels)": {
"url": "http://maps.wikimedia.org/osm/{z}/{x}/{y}.png",
"attributions": "<a target=\"_blank\" href=\"https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\">Wikimedia</a>",
"minZoom": 1,
"maxZoom": 19,
"oldIndex": 17
"maxZoom": 19
},
"Watercolor by Stamen (No Labels)": {
"url": "http://stamen-tiles-{a-d}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png",
"attributions": "<a target=\"_blank\" href=\"http://stamen.com\">Stamen Design</a>",
"minZoom": 1,
"maxZoom": 19,
"oldIndex": 18
"maxZoom": 19
},
"Humanitarian by OpenStreetMap (Intl)": {
"url": "http://{a-c}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",
"attributions": "<a href=\"http://openstreetmap.org/\" target=\"_blank\">OpenStreetMap</a>",
"minZoom": 0,
"maxZoom": 19,
"oldIndex": 19
"maxZoom": 19
},
"Dark Gray by Esri (English)": {
"url": "http://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",
"attributions": "&copy; Esri",
"maxZoom": 19,
"oldIndex": 20
"maxZoom": 19
},
"Light Gray by Esri (English)": {
"url": "http://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",
"attributions": "&copy; Esri",
"maxZoom": 16,
"oldIndex": 21
"maxZoom": 16
},
"City Lights by NASA (No Labels)": {
"url": "http://map1.vis.earthdata.nasa.gov/wmts-webmerc/VIIRS_CityLights_2012/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpg",
"attributions": "&copy; NASA",
"maxZoom": 8,
"oldIndex": 22
"maxZoom": 8
},
"Midnight Commander by Carto (No Labels)": {
"url": "https://cartocdn_{a-d}.global.ssl.fastly.net/base-midnight/{z}/{x}/{y}.png",
"attributions": "&copy; Carto",
"maxZoom": 19,
"oldIndex": 23
"maxZoom": 19
},
"Antique by Carto (Minimal Labels)": {
"url": "https://cartocdn_{a-d}.global.ssl.fastly.net/base-antique/{z}/{x}/{y}.png",
"attributions": "&copy; Carto",
"maxZoom": 19,
"oldIndex": 24
"maxZoom": 19
},
"Eco by Carto (Minimal Labels)": {
"url": "https://cartocdn_{a-d}.global.ssl.fastly.net/base-eco/{z}/{x}/{y}.png",
@ -158,65 +135,55 @@
"Voyager by Carto (English)": {
"url": "https://{a-d}.basemaps.cartocdn.com/rastertiles/voyager_labels_under/{z}/{x}/{y}.png",
"attributions": "&copy; Carto",
"maxZoom": 19,
"oldIndex": 26
"maxZoom": 19
},
"Positron by Carto (English)": {
"url": "https://{a-d}.basemaps.cartocdn.com/rastertiles/light_all/{z}/{x}/{y}.png",
"attributions": "&copy; Carto",
"maxZoom": 19,
"oldIndex": 27
"maxZoom": 19
},
"Dark Matter by Carto (English)": {
"url": "https://{a-d}.basemaps.cartocdn.com/rastertiles/dark_all/{z}/{x}/{y}.png",
"attributions": "&copy; Carto",
"maxZoom": 19,
"oldIndex": 28
"maxZoom": 19
},
"Voyager by Carto (No Labels)": {
"url": "https://{a-d}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}.png",
"attributions": "&copy; Carto",
"maxZoom": 19,
"oldIndex": 29
"maxZoom": 19
},
"Positron by Carto (No Labels)": {
"url": "https://{a-d}.basemaps.cartocdn.com/rastertiles/light_nolabels/{z}/{x}/{y}.png",
"attributions": "&copy; Carto",
"maxZoom": 19,
"oldIndex": 30
"maxZoom": 19
},
"Dark Matter by Carto (No Labels)": {
"url": "https://{a-d}.basemaps.cartocdn.com/rastertiles/dark_nolabels/{z}/{x}/{y}.png",
"attributions": "&copy; Carto",
"maxZoom": 19,
"oldIndex": 31
"maxZoom": 19
},
"Geography Class by Mapbox (English)": {
"url": "http://{a-b}.tiles.mapbox.com/v3/aj.1x1-degrees/{z}/{x}/{y}.png",
"attributions": "&copy; mapbox",
"maxZoom": 19,
"oldIndex": 32
"maxZoom": 19
},
"Flat Blue by Carto (No Labels)": {
"url": "https://cartocdn_{a-d}.global.ssl.fastly.net/base-flatblue/{z}/{x}/{y}.png",
"attributions": "&copy; Carto",
"maxZoom": 19,
"oldIndex": 33
"maxZoom": 19
},
"Satellite by MapTiler (No Labels)(Offline)": {
"url": "/map/sat/{z}/{x}/{y}.png",
"attributions": "MapTiler",
"minZoom": 0,
"maxZoom": 5,
"offline": true,
"oldIndex": 34
"offline": true
},
"HamGames by N0TTL (Intl)(Offline)": {
"url": "/map/hamgames/{z}/{x}/{y}.png",
"attributions": "Mapbox",
"minZoom": 0,
"maxZoom": 5,
"offline": true,
"oldIndex": 35
"offline": true
}
}
}

Wyświetl plik

@ -5503,41 +5503,14 @@ function initMap()
var saveSettings = false;
g_maps = Object.keys(g_maps).sort().reduce((obj, key) => { obj[key] = g_maps[key]; return obj; }, {});
if (typeof g_mapSettings.mapIndex == "number")
if (!(g_mapSettings.mapIndex in g_maps))
{
var foundKey = null;
for (const key in g_maps)
{
if (g_maps[key].oldIndex == g_mapSettings.mapIndex)
{
g_mapSettings.mapIndex = key;
foundKey = key;
break;
}
}
if (foundKey == null)
{
g_mapSettings.mapIndex = def_mapSettings.mapIndex;
}
g_mapSettings.mapIndex = def_mapSettings.mapIndex;
saveSettings = true;
}
if (typeof g_mapSettings.nightMapIndex == "number")
if (!(g_mapSettings.nightMapIndex in g_maps))
{
var foundKey = null;
for (const key in g_maps)
{
if (g_maps[key].oldIndex == g_mapSettings.nightMapIndex)
{
g_mapSettings.nightMapIndex = key;
foundKey = key;
break;
}
}
if (foundKey == null)
{
g_mapSettings.nightMapIndex = def_mapSettings.nightMapIndex;
}
g_mapSettings.nightMapIndex = def_mapSettings.nightMapIndex;
saveSettings = true;
}
if (saveSettings)