From 98bc7c8487a20630aef4f580cf3e66a14c2c4669 Mon Sep 17 00:00:00 2001 From: Lingbo Jiang Date: Tue, 10 Dec 2024 11:57:48 +1100 Subject: [PATCH 1/3] AUS-4295 Added urllink works for nvclanid. --- src/app/cesium-map/csmap.component.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/app/cesium-map/csmap.component.ts b/src/app/cesium-map/csmap.component.ts index be0502e7..8c93855c 100644 --- a/src/app/cesium-map/csmap.component.ts +++ b/src/app/cesium-map/csmap.component.ts @@ -20,6 +20,7 @@ import { GeoJsonQuerierHandler } from './custom-querier-handler/geojson-querier- import { Observable, forkJoin, throwError } from 'rxjs'; import { catchError, finalize, tap, timeout } from 'rxjs/operators'; import { ToolbarComponent } from 'app/menupanel/toolbar/toolbar.component'; +import { NVCLBoreholeAnalyticService } from 'app/modalwindow/layeranalytic/nvcl/nvcl.boreholeanalytic.service'; declare var Cesium: any; @@ -44,7 +45,7 @@ declare var Cesium: any; `, - providers: [ViewerConfiguration], // Don't forget to Provide it + providers: [ViewerConfiguration,NVCLBoreholeAnalyticService], // Don't forget to Provide it styleUrls: ['./csmap.component.scss'] // The "#" (template reference variable) matters to access the map element with the ViewChild decorator! }) @@ -78,7 +79,8 @@ export class CsMapComponent implements AfterViewInit { constructor(private csMapObject: CsMapObject, private csMapService: CsMapService, private modalService: BsModalService, private queryWMSService: QueryWMSService, private gmlParserService: GMLParserService, private manageStateService: ManageStateService, private advancedMapComponentService: AdvancedComponentService, - private userStateService: UserStateService, private viewerConf: ViewerConfiguration, private ngZone: NgZone) { + private userStateService: UserStateService, private nvclBoreholeAnalyticService: NVCLBoreholeAnalyticService, + private viewerConf: ViewerConfiguration, private ngZone: NgZone) { this.csMapService.getClickedLayerListBS().subscribe((mapClickInfo) => { this.handleLayerClick(mapClickInfo); }); @@ -178,6 +180,16 @@ export class CsMapComponent implements AfterViewInit { ngAfterViewInit() { this.csMapService.init(); + // This code is used to display the map for nvclanid job's urlLink + const nvclanid = UtilitiesService.getUrlParameterByName('nvclanid'); + if (nvclanid) { + const me = this; + this.nvclBoreholeAnalyticService.getNVCLGeoJson(nvclanid).subscribe(results => { + const jsonData = results; + me.nvclBoreholeAnalyticService.addGeoJsonLayer(nvclanid,jsonData); + }); + return; + } // This code is used to display the map state stored in a permanent link const stateId = UtilitiesService.getUrlParameterByName('state'); From 1a32d28de1064c2edcc2c8360f7c1681d5d0d715 Mon Sep 17 00:00:00 2001 From: Lingbo Jiang Date: Tue, 10 Dec 2024 13:01:32 +1100 Subject: [PATCH 2/3] AUS-4295 Added error for no job found for nvclanid --- src/app/cesium-map/csmap.component.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/cesium-map/csmap.component.ts b/src/app/cesium-map/csmap.component.ts index 8c93855c..9b122d48 100644 --- a/src/app/cesium-map/csmap.component.ts +++ b/src/app/cesium-map/csmap.component.ts @@ -184,10 +184,16 @@ export class CsMapComponent implements AfterViewInit { const nvclanid = UtilitiesService.getUrlParameterByName('nvclanid'); if (nvclanid) { const me = this; - this.nvclBoreholeAnalyticService.getNVCLGeoJson(nvclanid).subscribe(results => { - const jsonData = results; - me.nvclBoreholeAnalyticService.addGeoJsonLayer(nvclanid,jsonData); - }); + + this.nvclBoreholeAnalyticService.getNVCLGeoJson(nvclanid).subscribe(results => { + if (typeof results === 'object') { + window.alert('This analytical job could not be found!\n the nvclanid = ' + nvclanid); + return; + } + const jsonData = results; + me.nvclBoreholeAnalyticService.addGeoJsonLayer(nvclanid,jsonData); + }); + return; } From 2c9f5ce855212f65f18672b4bd5aa575f36749a2 Mon Sep 17 00:00:00 2001 From: Lingbo Jiang Date: Tue, 10 Dec 2024 13:15:32 +1100 Subject: [PATCH 3/3] AUS-4295 Removed the unused nvclanid filter. --- src/app/cesium-map/csmap.component.ts | 15 ++++++--------- .../common/filterpanel/filterpanel.component.ts | 10 ---------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/app/cesium-map/csmap.component.ts b/src/app/cesium-map/csmap.component.ts index 9b122d48..caa5c62c 100644 --- a/src/app/cesium-map/csmap.component.ts +++ b/src/app/cesium-map/csmap.component.ts @@ -184,17 +184,14 @@ export class CsMapComponent implements AfterViewInit { const nvclanid = UtilitiesService.getUrlParameterByName('nvclanid'); if (nvclanid) { const me = this; - - this.nvclBoreholeAnalyticService.getNVCLGeoJson(nvclanid).subscribe(results => { - if (typeof results === 'object') { - window.alert('This analytical job could not be found!\n the nvclanid = ' + nvclanid); - return; - } + this.nvclBoreholeAnalyticService.getNVCLGeoJson(nvclanid).subscribe(results => { + if (typeof results === 'object') { + window.alert('This analytical job could not be found!\n the nvclanid = ' + nvclanid); + } else { const jsonData = results; me.nvclBoreholeAnalyticService.addGeoJsonLayer(nvclanid,jsonData); - }); - - return; + } + }); } // This code is used to display the map state stored in a permanent link diff --git a/src/app/menupanel/common/filterpanel/filterpanel.component.ts b/src/app/menupanel/common/filterpanel/filterpanel.component.ts index cb5d615f..060e27c9 100644 --- a/src/app/menupanel/common/filterpanel/filterpanel.component.ts +++ b/src/app/menupanel/common/filterpanel/filterpanel.component.ts @@ -95,16 +95,6 @@ export class FilterPanelComponent implements OnInit, AfterViewInit { // Add any layer specific advanced filter components this.advancedComponentService.addAdvancedFilterComponents(this.layer, this.advancedFilterComponents); - // LJ: nvclAnalyticalJob external link - const nvclanid = UtilitiesService.getUrlParameterByName('nvclanid'); - if (nvclanid) { - if (this.layer.id === 'nvcl-v2-borehole') { - this.layer.filterCollection['mandatoryFilters'][0].value = nvclanid; - setTimeout(() => { - this.addLayer(this.layer); - }); - } - } } /**