Skip to content

Commit

Permalink
Fix pre-selection for tileIds
Browse files Browse the repository at this point in the history
  • Loading branch information
Waguramu committed Nov 5, 2024
1 parent ec15c72 commit a243647
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions erdblick_app/app/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,14 @@ export class MapService {
this.zoomLevel.next(MAX_ZOOM_LEVEL);
}

*tileLayersForTileId(tileId: bigint): Generator<FeatureTile> {
for (const tile of this.loadedTileLayers.values()) {
if (tile.tileId == tileId) {
yield tile;
}
}
}

private visualizeHighlights(mode: HighlightMode, featureWrappers: Array<FeatureWrapper>) {
let visualizationCollection = null;
switch (mode) {
Expand Down
4 changes: 3 additions & 1 deletion erdblick_app/app/sourcedataselection.dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export class SourceDataLayerSelectionDialogComponent {
}

// Pre-select the tile ID.
let tileIdSelection = this.tileIds.find(element => !element.disabled);
let tileIdSelection = this.tileIds.find(element =>
!element.disabled && [...this.mapService.tileLayersForTileId(element.id as bigint)]
);
if (tileIdSelection) {
this.setCurrentTileId(tileIdSelection);
}
Expand Down

0 comments on commit a243647

Please sign in to comment.