UI: Fixed process tiles URL in vector map
This commit is contained in:
parent
760d1cb280
commit
bfec366fcb
@ -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;
|
||||
|
||||
@ -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": [
|
||||
|
||||
@ -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": [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user