@regionerne/gis-komponent 0.0.58 → 0.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3038,6 +3038,7 @@ class ToolboxComponent {
3038
3038
  _enablePointSearch() {
3039
3039
  if (this.activeMode === 'search-point')
3040
3040
  this.geometrySearchResult = [];
3041
+ this._disablePointSearch();
3041
3042
  this.pointClickKey = this.map.on('singleclick', (evt) => {
3042
3043
  const point = new Point$1(evt.coordinate);
3043
3044
  if (this.activeMode === 'search-point') {
@@ -3342,7 +3343,9 @@ class ToolboxComponent {
3342
3343
  // Set the first item as default
3343
3344
  if (!this.selectedDrawItem && this.drawItems && this.drawItems.length > 0) {
3344
3345
  this.selectedDrawItem = this.drawItems[0];
3345
- // Actually start drawing immediately
3346
+ }
3347
+ // Actually start drawing immediately
3348
+ if (this.selectedDrawItem) {
3346
3349
  this._doStartDraw(this.selectedDrawItem);
3347
3350
  }
3348
3351
  }
@@ -3690,6 +3693,7 @@ class ToolboxComponent {
3690
3693
  if (this.pointClickKey) {
3691
3694
  unByKey(this.pointClickKey);
3692
3695
  }
3696
+ this._disablePointSearch();
3693
3697
  this._documentSearch.stop();
3694
3698
  this._showInfo.stopShowInfo();
3695
3699
  }
@@ -4461,7 +4465,8 @@ class WFSSearchService {
4461
4465
  return result;
4462
4466
  })));
4463
4467
  });
4464
- return wftSearches;
4468
+ // Force an empty response if no searchable layers
4469
+ return wftSearches.length > 0 ? wftSearches : [of({ title: '', total: 0, items: [] })];
4465
4470
  }
4466
4471
  setSearcheableLayers(layers) {
4467
4472
  this._searcheableLayers = layers;