diff --git a/src/app/core/services/app-config.service.ts b/src/app/core/services/app-config.service.ts index d733ce6a03c5f6ecba170b1f619df064094ca215..c869cc21b9d87f36ed23df75f5ef67fc5d69f834 100644 --- a/src/app/core/services/app-config.service.ts +++ b/src/app/core/services/app-config.service.ts @@ -17,6 +17,7 @@ export class AppConfig { wms: string; mvt: string; seo: string; + openMapTiles: string; }; theFunctionalitiesInterruptor: { credits: boolean; diff --git a/src/app/map/components/map.component.ts b/src/app/map/components/map.component.ts index a4ebce8614219fca9ee443dcd2e77b703a69fb6f..42f4e1a4c45ac3b0893cd9b9ba40123f32473ad0 100644 --- a/src/app/map/components/map.component.ts +++ b/src/app/map/components/map.component.ts @@ -59,7 +59,7 @@ export class MapComponent implements OnInit, OnDestroy { } this.initilizeLanguage(); - // this.initAvailableLayers(); + this.constructMap(); } @@ -197,7 +197,7 @@ export class MapComponent implements OnInit, OnDestroy { mapboxOptions['bounds'] = bounds; } - mapboxOptions['style'] = `assets/mapbox-gl-styles/${this.selectedBaseLayer.fileName}`; + mapboxOptions['style'] = this.selectedBaseLayer.urlJson; // Create the map with the associated style Mapbox file // tslint:disable-next-line: max-line-length diff --git a/src/app/map/services/map.service.ts b/src/app/map/services/map.service.ts index 5941abd2b79fb1c2279fbd26b6aca599b1c3d85d..eddc0f07784f38bb28f611cc74607e9b4e63b98c 100644 --- a/src/app/map/services/map.service.ts +++ b/src/app/map/services/map.service.ts @@ -433,7 +433,7 @@ fpc_fond_plan_communaut.fpctoit&map.imagetype=mvt&tilemode=gmap&tile={x}+{y}+{z} } this._map.setMaxZoom(this.selectedBaseLayer.maxzoom); - this._map.setStyle(`assets/mapbox-gl-styles/${this.selectedBaseLayer.fileName}`); + this._map.setStyle(this.selectedBaseLayer.urlJson); } setSelectedFeature(selectedFeature) { diff --git a/src/app/map/settings.ts b/src/app/map/settings.ts index b08e25eca920f32fad8eeb37b1fb6962251554cd..ea88d0b511a3cf6a742c8d5f0c3f2ad94e6df984 100644 --- a/src/app/map/settings.ts +++ b/src/app/map/settings.ts @@ -1,3 +1,5 @@ +import { APP_CONFIG } from '../core/services/app-config.service'; + export const settings = { // Map @@ -6,7 +8,7 @@ export const settings = { { id: 2, maxzoom: 21, - fileName: 'vector.json', + urlJson: `${APP_CONFIG.backendUrls.openMapTiles}/styles/vector/style.json`, labels: { fr: 'Carte', en: 'Map', @@ -15,7 +17,7 @@ export const settings = { { id: 4, maxzoom: 21, - fileName: 'satellite.json', + urlJson: `${APP_CONFIG.backendUrls.openMapTiles}/styles/aerial/style.json`, labels: { fr: 'Satellite', en: 'Satellite', diff --git a/src/assets/config/config.json b/src/assets/config/config.json index 914e53c212600dedbe0b1076666d882095c66f8d..4005b293fc51e04e2d7a3092711be9d939a02658 100644 --- a/src/assets/config/config.json +++ b/src/assets/config/config.json @@ -14,7 +14,8 @@ "wms": "https://data-reloaded-dev.alpha.grandlyon.com/api/services/wms", "mvt": "https://data-reloaded-dev.alpha.grandlyon.com/api/services/mvt", "geocoder": "https://download.data.grandlyon.com/geocoding/photon", - "seo": "/share" + "seo": "/share", + "openMapTiles": "https://openmaptiles.recette.data.grandlyon.com" }, "theFunctionalitiesInterruptor": { "credits": true,