Add new map provider

This commit is contained in:
Alexander Heinke 2026-02-21 02:15:27 +01:00
parent 8bb4d9d9dd
commit 7a57d252dd

View file

@ -1481,7 +1481,7 @@
} }
function getConfigMapSelectedTileLayer() { function getConfigMapSelectedTileLayer() {
return localStorage.getItem("config_map_selected_tile_layer") || "OpenStreetMap"; return localStorage.getItem("config_map_selected_tile_layer") || "Thunderforest Neighbourhood";
} }
function setConfigMapSelectedTileLayer(layer) { function setConfigMapSelectedTileLayer(layer) {
@ -2632,6 +2632,21 @@
// remove leaflet link // remove leaflet link
map.attributionControl.setPrefix(''); map.attributionControl.setPrefix('');
var openThunderforestLandscapeMapTileLayer = L.tileLayer('https://tiles.nixware.dev/landscape/{z}/{x}/{y}.png', {
maxZoom: 22,
attribution: 'Tiles &copy; <a href="https://www.thunderforest.com/contact/">Gravitystorm Limited | Data from <a target="_blank" href="https://meshtastic.org/docs/software/integrations/mqtt/">Meshtastic</a>',
});
var openThunderforestAtlasMapTileLayer = L.tileLayer('https://tiles.nixware.dev/atlas/{z}/{x}/{y}.png', {
maxZoom: 22,
attribution: 'Tiles &copy; <a href="https://www.thunderforest.com/contact/">Gravitystorm Limited | Data from <a target="_blank" href="https://meshtastic.org/docs/software/integrations/mqtt/">Meshtastic</a>',
});
var openThunderforestNeighbourhoodMapTileLayer = L.tileLayer('https://tiles.nixware.dev/neighbourhood/{z}/{x}/{y}.png', {
maxZoom: 22,
attribution: 'Tiles &copy; <a href="https://www.thunderforest.com/contact/">Gravitystorm Limited | Data from <a target="_blank" href="https://meshtastic.org/docs/software/integrations/mqtt/">Meshtastic</a>',
});
var openStreetMapTileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { var openStreetMapTileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 22, // increase from 18 to 22 maxZoom: 22, // increase from 18 to 22
attribution: 'Tiles &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> | Data from <a target="_blank" href="https://meshtastic.org/docs/software/integrations/mqtt/">Meshtastic</a>', attribution: 'Tiles &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> | Data from <a target="_blank" href="https://meshtastic.org/docs/software/integrations/mqtt/">Meshtastic</a>',
@ -2639,7 +2654,7 @@
var openTopoMapTileLayer = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', { var openTopoMapTileLayer = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
maxZoom: 17, // open topo map doesn't have tiles closer than this maxZoom: 17, // open topo map doesn't have tiles closer than this
attribution: 'Tiles &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>', attribution: 'Tiles &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap | Data from <a target="_blank" href="https://meshtastic.org/docs/software/integrations/mqtt/">Meshtastic</a>',
}); });
var esriWorldImageryTileLayer = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { var esriWorldImageryTileLayer = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
@ -2659,7 +2674,10 @@
attribution: 'Tiles &copy; Google | Data from <a target="_blank" href="https://meshtastic.org/docs/software/integrations/mqtt/">Meshtastic</a>' attribution: 'Tiles &copy; Google | Data from <a target="_blank" href="https://meshtastic.org/docs/software/integrations/mqtt/">Meshtastic</a>'
}); });
var tileLayers = { var tileLayers = {
"Thunderforest Neighbourhood": openThunderforestNeighbourhoodMapTileLayer,
"Thunderforest Landscape": openThunderforestLandscapeMapTileLayer,
"Thunderforest Atlas": openThunderforestAtlasMapTileLayer,
"OpenStreetMap": openStreetMapTileLayer, "OpenStreetMap": openStreetMapTileLayer,
"OpenTopoMap": openTopoMapTileLayer, "OpenTopoMap": openTopoMapTileLayer,
"Esri Satellite": esriWorldImageryTileLayer, "Esri Satellite": esriWorldImageryTileLayer,
@ -2669,7 +2687,7 @@
// use tile layer based on config // use tile layer based on config
const selectedTileLayerName = getConfigMapSelectedTileLayer(); const selectedTileLayerName = getConfigMapSelectedTileLayer();
const selectedTileLayer = tileLayers[selectedTileLayerName] || openStreetMapTileLayer; const selectedTileLayer = tileLayers[selectedTileLayerName] || openThunderforestNeighbourhoodMapTileLayer;
selectedTileLayer.addTo(map); selectedTileLayer.addTo(map);
// create layer groups // create layer groups