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(
|
return spec$.pipe(
|
||||||
map(spec => {
|
map(spec => {
|
||||||
const sourceSpec = (spec.sources['esri'] as VectorSourceSpecification);
|
const sourceSpec = (spec.sources['esri'] as VectorSourceSpecification);
|
||||||
const tileUrl = sourceSpec.url;
|
|
||||||
const attribution = sourceSpec.attribution;
|
const attribution = sourceSpec.attribution;
|
||||||
const transformRequest = (url: string, resourceType: ResourceType) => {
|
|
||||||
if (resourceType === 'Tile') {
|
|
||||||
url = tileUrl + '/' + url;
|
|
||||||
}
|
|
||||||
return {url}
|
|
||||||
}
|
|
||||||
const gl = L.maplibreGL({
|
const gl = L.maplibreGL({
|
||||||
style: spec,
|
style: spec,
|
||||||
transformRequest
|
|
||||||
});
|
});
|
||||||
gl.options.attribution = attribution;
|
gl.options.attribution = attribution;
|
||||||
return gl;
|
return gl;
|
||||||
|
|||||||
@ -6,7 +6,10 @@
|
|||||||
"esri": {
|
"esri": {
|
||||||
"type": "vector",
|
"type": "vector",
|
||||||
"url": "https://basemaps.arcgis.com/arcgis/rest/services/OpenStreetMap_v2/VectorTileServer",
|
"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": [
|
"layers": [
|
||||||
|
|||||||
@ -6,7 +6,10 @@
|
|||||||
"esri": {
|
"esri": {
|
||||||
"type": "vector",
|
"type": "vector",
|
||||||
"url": "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer",
|
"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": [
|
"layers": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user