From 015f8f1820d904361a8ea15bda2530ba769aaa13 Mon Sep 17 00:00:00 2001 From: "stuart.woodman" Date: Wed, 21 Aug 2024 16:06:34 +1000 Subject: [PATCH] Fixed error where de-selecting Restrict Spatial Bounds search option would not stop bounds restriction. --- .../menupanel/search/searchpanel.component.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/app/menupanel/search/searchpanel.component.ts b/src/app/menupanel/search/searchpanel.component.ts index 270f9a85..f1dda0b0 100644 --- a/src/app/menupanel/search/searchpanel.component.ts +++ b/src/app/menupanel/search/searchpanel.component.ts @@ -450,7 +450,6 @@ export class SearchPanelComponent implements OnInit { * @param layer LayerModel of layer */ public layerWarningMessage(layer: LayerModel): string { - console.log("[searchpanel.component.ts]layerWarningMessage()"); return 'This layer cannot be displayed. For Featured Layers, please wait for the layer cache to rebuild itself. ' + 'For Custom Layers please note that only the following online resource types can be added to the map: ' + this.csMapService.getSupportedOnlineResourceTypes(); @@ -719,10 +718,21 @@ export class SearchPanelComponent implements OnInit { } } + let westBounds = undefined; + let eastBounds = undefined; + let northBounds = undefined; + let southBounds = undefined; + if (this.restrictBounds && this.bbox) { + westBounds = this.bbox.westBoundLongitude; + eastBounds = this.bbox.eastBoundLongitude; + northBounds = this.bbox.northBoundLatitude; + southBounds = this.bbox.southBoundLatitude; + } + // Search CSW records this.searchService.searchCSWRecords(this.queryText, selectedSearchFields, null, null, selectedServices, - this.boundsRelationship.toLowerCase(), this.bbox?.westBoundLongitude, this.bbox?.eastBoundLongitude, - this.bbox?.southBoundLatitude, this.bbox?.northBoundLatitude).subscribe(searchResponse => { + this.boundsRelationship.toLowerCase(), westBounds, eastBounds, + southBounds, northBounds).subscribe(searchResponse => { this.searchResults = []; this.totalSearchHits = searchResponse.totalCSWRecordHits;