UI: Fixed process tiles URL in vector map

This commit is contained in:
Vladyslav_Prykhodko 2025-03-12 11:11:39 +02:00
parent 760d1cb280
commit bfec366fcb
3 changed files with 8 additions and 10 deletions

View File

@ -165,17 +165,9 @@ export abstract class TbMapLayer<S extends MapLayerSettings> {
return spec$.pipe(
map(spec => {
const sourceSpec = (spec.sources['esri'] as VectorSourceSpecification);
const tileUrl = sourceSpec.url;
const attribution = sourceSpec.attribution;
const transformRequest = (url: string, resourceType: ResourceType) => {
if (resourceType === 'Tile') {
url = tileUrl + '/' + url;
}
return {url}
}
const gl = L.maplibreGL({
style: spec,
transformRequest
});
gl.options.attribution = attribution;
return gl;

View File

@ -6,7 +6,10 @@
"esri": {
"type": "vector",
"url": "https://basemaps.arcgis.com/arcgis/rest/services/OpenStreetMap_v2/VectorTileServer",
"attribution": "Map data (c) OpenStreetMap contributors, Microsoft, Facebook, Google, Esri Community Maps contributors, Map layer by Esri"
"attribution": "Map data (c) OpenStreetMap contributors, Microsoft, Facebook, Google, Esri Community Maps contributors, Map layer by Esri",
"tiles": [
"https://basemaps.arcgis.com/arcgis/rest/services/OpenStreetMap_v2/VectorTileServer/tile/{z}/{y}/{x}.pbf"
]
}
},
"layers": [

View File

@ -6,7 +6,10 @@
"esri": {
"type": "vector",
"url": "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer",
"attribution": "Sources: Esri, TomTom, Garmin, FAO, NOAA, USGS, © OpenStreetMap contributors, and the GIS User Community"
"attribution": "Sources: Esri, TomTom, Garmin, FAO, NOAA, USGS, © OpenStreetMap contributors, and the GIS User Community",
"tiles": [
"https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/tile/{z}/{y}/{x}.pbf"
]
}
},
"layers": [