use maptiler satellite

This commit is contained in:
vcoppe
2026-05-25 14:45:03 +02:00
parent 161c664e08
commit 88e301e2a2
2 changed files with 17 additions and 8 deletions
+5 -8
View File
@@ -5,21 +5,18 @@
"type": "vector", "type": "vector",
"url": "https://gpxstudio.xyz/openmaptiles.json" "url": "https://gpxstudio.xyz/openmaptiles.json"
}, },
"esri": { "maptiler": {
"type": "raster", "url":"https://api.maptiler.com/tiles/satellite-v2/tiles.json?key=MAPTILER_KEY",
"tiles": ["https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/WMTS/tile/1.0.0/World_Imagery/default/default028mm/{z}/{y}/{x}.jpg"], "type":"raster"
"tileSize": 256,
"maxzoom": 19,
"attribution": "© <a href=\"https://www.esri.com/\" target=\"_blank\">Esri</a>, Vantor, Earthstar Geographics, and the GIS User Community"
} }
}, },
"sprite": "https://tiles.openfreemap.org/sprites/ofm_f384/ofm", "sprite": "https://tiles.openfreemap.org/sprites/ofm_f384/ofm",
"glyphs": "https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf", "glyphs": "https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",
"layers": [ "layers": [
{ {
"id": "esri", "id": "maptiler",
"type": "raster", "type": "raster",
"source": "esri" "source": "maptiler"
}, },
{ {
+12
View File
@@ -199,6 +199,18 @@ export class StyleManager {
const style = await response.json(); const style = await response.json();
return style; return style;
} else { } else {
for (const source in styleInfo.sources) {
const src = styleInfo.sources[source];
if (
src &&
typeof src === 'object' &&
'url' in src &&
typeof src.url === 'string' &&
src.url.includes(maptilerKeyPlaceHolder)
) {
src.url = src.url.replace(maptilerKeyPlaceHolder, this._maptilerKey);
}
}
return styleInfo; return styleInfo;
} }
} }