Skip to content
Snippets Groups Projects
Commit 2c23e50a authored by ncastejon's avatar ncastejon
Browse files

Fix table-map display for ATMO providers.

parent 0000783a
Branches
Tags
1 merge request!54Version 2.3.2 fix
...@@ -79,7 +79,7 @@ export class DatasetMapComponent implements OnInit, OnDestroy { ...@@ -79,7 +79,7 @@ export class DatasetMapComponent implements OnInit, OnDestroy {
this.mapOptions.vectorService = { ...this.metadata.link.find((e) => { return e.service === linkFormats.wfs; }) }; this.mapOptions.vectorService = { ...this.metadata.link.find((e) => { return e.service === linkFormats.wfs; }) };
this.mapOptions.rasterService = { ...this.metadata.link.find((e) => { return e.service === linkFormats.wms; }) }; this.mapOptions.rasterService = { ...this.metadata.link.find((e) => { return e.service === linkFormats.wms; }) };
// For authentication reason, we do not use the open url of download.data for the WMS service. // For authentication reason, we do not use the open url of download.data for the WMS service.
// We use a kong endpoint for the url to be proxyfied // We use a kong endpoint for the url to be proxyfied
if (!this.mapOptions.rasterService) { if (!this.mapOptions.rasterService) {
return; return;
......
...@@ -129,7 +129,7 @@ export class ElasticsearchOptions { ...@@ -129,7 +129,7 @@ export class ElasticsearchOptions {
// Known licences // Known licences
get knownLicences() { get knownLicences() {
return ['Licence Ouverte', 'Licence Engagée', 'Licence Associée']; return ['Licence Ouverte', 'Licence ODbL', 'Licence de réutilisation des données d\'intérêt général'];
} }
// Getters // Getters
......
...@@ -123,27 +123,30 @@ export class MapService { ...@@ -123,27 +123,30 @@ export class MapService {
addLayers() { addLayers() {
this.addWMSLayer(); this.addWMSLayer();
// There is two ways to add tha data layers: from a geojson or from a MVT url // Add a geojson layer only if data from the metropole
if (!this.isMVT) { if (this.rasterService.url.includes('download.data')) {
if (this.geojson) { // There is two ways to add tha data layers: from a geojson or from a MVT url
this._map.addSource('vector-source', { if (!this.isMVT) {
type: 'geojson', if (this.geojson) {
data: this.geojson, this._map.addSource('vector-source', {
}); type: 'geojson',
this.addDataLayer(); data: this.geojson,
} });
} else { this.addDataLayer();
if (this.vectorService && this.vectorService.url) { }
const domain = this.vectorService.url.split('wfs')[1]; } else {
const url = `${this.mvtUrl}${domain}?LAYERS` + if (this.vectorService && this.vectorService.url) {
`=${this.vectorService.name}&map.imagetype=mvt&tilemode=gmap&tile={x}+{y}+{z}&mode=tile`; const domain = this.vectorService.url.split('wfs')[1];
const url = `${this.mvtUrl}${domain}?LAYERS` +
this._map.addSource('vector-source', { `=${this.vectorService.name}&map.imagetype=mvt&tilemode=gmap&tile={x}+{y}+{z}&mode=tile`;
type: 'vector',
tiles: [url], this._map.addSource('vector-source', {
}); type: 'vector',
tiles: [url],
this.addDataLayer(); });
this.addDataLayer();
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment