diff --git a/src/app/map/components/map.component.html b/src/app/map/components/map.component.html index 17b02e22bbd2da1213e9e86a32121bf8e287265f..e5e24a9e236c1b1b7fe713f37a935728a855f515 100644 --- a/src/app/map/components/map.component.html +++ b/src/app/map/components/map.component.html @@ -63,7 +63,7 @@ </div> </div> </div> - <div class="columns is-mobile update-map" *ngIf="displayMessageLimitedFeatures"> + <div class="columns is-mobile update-map" *ngIf="displayMessageLimitedFeatures && currentLayerType === linkFormats.wfs"> <div class="column is-narrow"> <div class="column-content"> <div class="message is-medium"> diff --git a/src/app/map/components/map.component.ts b/src/app/map/components/map.component.ts index a528af97b4e6838f31b7fc211e44005154d79846..c3b3d14b77aec4da59fae70a0700f1fe0d61fd7c 100644 --- a/src/app/map/components/map.component.ts +++ b/src/app/map/components/map.component.ts @@ -6,6 +6,7 @@ import { DatasetDetailService } from '../../geosource/services'; import { MapService } from '../services/map.service'; import { settings } from '../settings'; import { geosource } from '../../../i18n/traductions'; +import { linkFormats } from '../../geosource/models/metadata.model'; @Component({ selector: 'app-map', @@ -16,6 +17,7 @@ import { geosource } from '../../../i18n/traductions'; export class MapComponent implements OnInit, OnDestroy { settings = settings; + linkFormats = linkFormats; lang: string; // (fr or en) metadata: Metadata; @@ -39,6 +41,7 @@ export class MapComponent implements OnInit, OnDestroy { totalData = 0; previousDatasetId: string; + currentLayerType: string; baseLayer3d = 1; displayControls = false; @@ -159,6 +162,7 @@ export class MapComponent implements OnInit, OnDestroy { // (and not on map loaded, because when the style is refreshed, it removes all the sources associated) this.map.on('style.load', () => { this._mapService.addLayers(); + this.currentLayerType = this._mapService.currentLayerType; }); this._mapService.previousDatasetId = this.metadata.dataset_id; diff --git a/src/app/map/services/map.service.ts b/src/app/map/services/map.service.ts index 48cd62fc563fc13f7e09c2620885973344afc088..581d8f7fa2ae06bfd9d993b47ee212b8d3745280 100644 --- a/src/app/map/services/map.service.ts +++ b/src/app/map/services/map.service.ts @@ -25,6 +25,7 @@ export class MapService { eventPopupAdded = false; minimap: Minimap; mapIsConstructed: boolean = false; + _currentLayerType: string; // Map featureColor: string = '#d24796'; @@ -124,7 +125,7 @@ export class MapService { // Check if the metadata has WFS data format. const uriWFS = this.metadata.link.find((e) => { return e.service === linkFormats.wfs; }); if (uriWFS && this._datasetDetailService.datasetDataNumber < 100000) { - + this._currentLayerType = linkFormats.wfs; this.getWFSFeatures( this.metadata, settings.maxDisplayFeatures).subscribe((geojson) => { @@ -140,6 +141,7 @@ export class MapService { }); } else { + this._currentLayerType = linkFormats.wms; const uriWMS = this.metadata.link.find((e) => { return e.service === linkFormats.wms; }); this.addWMSLayer(uriWMS); } @@ -644,6 +646,10 @@ export class MapService { return this._mapToUpdate.asObservable(); } + get currentLayerType() { + return this._currentLayerType; + } + get mapUpdated$(): Observable<number> { return this._mapUpdated.asObservable(); }