Skip to content

Commit

Permalink
Additional small bugfixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
josephbirkner committed Sep 25, 2024
1 parent dfcadbc commit 0071d68
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion erdblick_app/app/feature.search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
3 changes: 0 additions & 3 deletions erdblick_app/app/features.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
6 changes: 3 additions & 3 deletions erdblick_app/app/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion erdblick_app/app/parameters.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const erdblickParameters: Record<string, ParameterDescriptor> = {
},
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
}
Expand Down
9 changes: 4 additions & 5 deletions erdblick_app/app/visualization.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 0 additions & 2 deletions libs/core/src/rule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit 0071d68

Please sign in to comment.