Browse Source
Merge pull request #12891 from vvlladd28/improvement/map/style-json-tiles
Fixed process tiles URL in vector map
pull/12894/head
Igor Kulikov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
8 additions and
10 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/maps/map-layer.ts
-
ui-ngx/src/assets/map/openstreetmap_hybrid_reference_style.json
-
ui-ngx/src/assets/map/world_edition_hybrid_reference_style.json
|
|
|
@ -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": [ |
|
|
|
|