From 0071d6868281a13ec4edd3bfc7a9a3dc9dfed8dd Mon Sep 17 00:00:00 2001 From: Joseph Birkner Date: Wed, 25 Sep 2024 16:25:07 +0200 Subject: [PATCH] Additional small bugfixes. --- erdblick_app/app/feature.search.component.ts | 2 +- erdblick_app/app/features.model.ts | 3 --- erdblick_app/app/map.service.ts | 6 +++--- erdblick_app/app/parameters.service.ts | 2 +- erdblick_app/app/visualization.model.ts | 9 ++++----- libs/core/src/rule.cpp | 2 -- 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/erdblick_app/app/feature.search.component.ts b/erdblick_app/app/feature.search.component.ts index 6cf2170a..3f35bf76 100644 --- a/erdblick_app/app/feature.search.component.ts +++ b/erdblick_app/app/feature.search.component.ts @@ -109,7 +109,7 @@ export class FeatureSearchComponent { } selectResult(event: any) { - if (event.value.mapId && event.value.featureId) { + if (event.value && event.value.mapId && event.value.featureId) { this.jumpService.highlightByJumpTargetFilter(event.value.mapId, event.value.featureId).then(() => { if (this.inspectionService.selectedFeatures.length) { this.mapService.focusOnFeature(this.inspectionService.selectedFeatures[0]); diff --git a/erdblick_app/app/features.model.ts b/erdblick_app/app/features.model.ts index 1a9c5d89..fcc5f048 100644 --- a/erdblick_app/app/features.model.ts +++ b/erdblick_app/app/features.model.ts @@ -171,9 +171,6 @@ export class FeatureWrapper { * @returns The value returned by the callback. */ peek(callback: any) { - if (this.featureTile.disposed) { - throw new Error(`Unable to access feature of deleted layer ${this.featureTile.mapTileKey}!`); - } return this.featureTile.peek((tileFeatureLayer: TileFeatureLayer) => { let feature = tileFeatureLayer.find(this.featureId); if (feature.isNull()) { diff --git a/erdblick_app/app/map.service.ts b/erdblick_app/app/map.service.ts index c83674d5..70a2ad01 100644 --- a/erdblick_app/app/map.service.ts +++ b/erdblick_app/app/map.service.ts @@ -178,12 +178,12 @@ export class MapService { this.update(); }) + await this.reloadDataSources(); + this.parameterService.parameters.pipe(distinctUntilChanged()).subscribe(parameters => { this.highlightFeatures(parameters.selected).then(); }); - await this.reloadDataSources(); - this.selectionTopic.subscribe(selectedFeatureWrappers => { this.visualizeHighlights(coreLib.HighlightMode.SELECTION_HIGHLIGHT, selectedFeatureWrappers); }); @@ -753,7 +753,7 @@ export class MapService { setTileLevelForViewport() { for (const level of [...Array(MAX_ZOOM_LEVEL + 1).keys()]) { - if (coreLib.getNumTileIds(this.currentViewport, level) >= 15) { + if (coreLib.getNumTileIds(this.currentViewport, level) >= 48) { this.zoomLevel.next(level); return; } diff --git a/erdblick_app/app/parameters.service.ts b/erdblick_app/app/parameters.service.ts index 85bd6d64..f21d0451 100644 --- a/erdblick_app/app/parameters.service.ts +++ b/erdblick_app/app/parameters.service.ts @@ -185,7 +185,7 @@ const erdblickParameters: Record = { }, panel: { converter: val => JSON.parse(val), - validator: val => Array.isArray(val) && val.length == 2 && val.every(item => typeof item === 'number'), + validator: val => Array.isArray(val) && (!val.length || val.length == 2 && val.every(item => typeof item === 'number')), default: [], urlParam: true } diff --git a/erdblick_app/app/visualization.model.ts b/erdblick_app/app/visualization.model.ts index dcf0d48d..0db041ee 100644 --- a/erdblick_app/app/visualization.model.ts +++ b/erdblick_app/app/visualization.model.ts @@ -159,8 +159,8 @@ export class TileVisualization { this.destroy(viewer); this.deleted = false; - // Do not try to render if the underlying data is disposed. - if (this.tile.disposed || this.style.isDeleted()) { + // Do not continue if the style was deleted while we were waiting. + if (this.style.isDeleted()) { return false; } @@ -200,9 +200,8 @@ export class TileVisualization { } let extRefsResolved = await response.json() as LocateResponse; - if (this.tile.disposed || this.style.isDeleted()) { - // Do not continue if any of the tiles or the style - // were deleted while we were waiting. + if (this.style.isDeleted()) { + // Do not continue if the style was deleted while we were waiting. return false; } diff --git a/libs/core/src/rule.cpp b/libs/core/src/rule.cpp index bde51f12..d5e6c00c 100644 --- a/libs/core/src/rule.cpp +++ b/libs/core/src/rule.cpp @@ -613,8 +613,6 @@ std::string FeatureStyleRule::labelText(BoundEvalFun const& evalFun) const if (!resultText.empty()) { return resultText; } - std::cout << "Empty return value for the label text expression: " << labelTextExpression_ - << ": " << resultVal.toString() << std::endl; return labelText_; } return labelText_;