From fd31fc54d25dc9b2bf362a2c9eb510f6b2a89486 Mon Sep 17 00:00:00 2001 From: Florent Gravin Date: Tue, 19 Nov 2024 14:07:47 +0100 Subject: [PATCH] gpf - use geoadmin.ch iframe for records which refers a map.geoadmin.ch link --- .../record-metadata.component.html | 14 ++++++++++++-- .../record-metadata.component.ts | 19 +++++++++++++++++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html index 8f5225f4e..15bd95ba5 100644 --- a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html +++ b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html @@ -81,7 +81,14 @@ style="height: 500px" *ngIf="displayMap$ | async" > - + + @@ -106,7 +113,10 @@
{ + return mapApiLinks?.find((link) => + link?.url.toString().startsWith('https://map.geo.admin.ch/') + ) + }), + filter((geoAdminUrl) => !!geoAdminUrl), + map((link) => + this.sanitizer.bypassSecurityTrustResourceUrl( + link.url.toString().replace('?layers=', '#/embed?layers=') + ) + ), + startWith(null) + ) + displayData$ = combineLatest([ this.metadataViewFacade.dataLinks$, this.metadataViewFacade.geoDataLinks$, @@ -149,6 +163,7 @@ export class RecordMetadataComponent { public metadataViewFacade: MdViewFacade, private searchService: SearchService, private sourceService: SourcesService, + private sanitizer: DomSanitizer, private orgsService: OrganizationsServiceInterface ) {}