Commit 2c23e50a authored by ncastejon's avatar ncastejon
Browse files

Fix table-map display for ATMO providers.

parent 0000783a
......@@ -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.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
if (!this.mapOptions.rasterService) {
return;
......
......@@ -129,7 +129,7 @@ export class ElasticsearchOptions {
// Known licences
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
......
......@@ -123,27 +123,30 @@ export class MapService {
addLayers() {
this.addWMSLayer();
// There is two ways to add tha data layers: from a geojson or from a MVT url
if (!this.isMVT) {
if (this.geojson) {
this._map.addSource('vector-source', {
type: 'geojson',
data: this.geojson,
});
this.addDataLayer();
}
} else {
if (this.vectorService && this.vectorService.url) {
const domain = this.vectorService.url.split('wfs')[1];
const url = `${this.mvtUrl}${domain}?LAYERS` +
`=${this.vectorService.name}&map.imagetype=mvt&tilemode=gmap&tile={x}+{y}+{z}&mode=tile`;
this._map.addSource('vector-source', {
type: 'vector',
tiles: [url],
});
this.addDataLayer();
// Add a geojson layer only if data from the metropole
if (this.rasterService.url.includes('download.data')) {
// There is two ways to add tha data layers: from a geojson or from a MVT url
if (!this.isMVT) {
if (this.geojson) {
this._map.addSource('vector-source', {
type: 'geojson',
data: this.geojson,
});
this.addDataLayer();
}
} else {
if (this.vectorService && this.vectorService.url) {
const domain = this.vectorService.url.split('wfs')[1];
const url = `${this.mvtUrl}${domain}?LAYERS` +
`=${this.vectorService.name}&map.imagetype=mvt&tilemode=gmap&tile={x}+{y}+{z}&mode=tile`;
this._map.addSource('vector-source', {
type: 'vector',
tiles: [url],
});
this.addDataLayer();
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment