diff --git a/erdblick_app/app/jump.service.ts b/erdblick_app/app/jump.service.ts
index b8c48e85..64c01204 100644
--- a/erdblick_app/app/jump.service.ts
+++ b/erdblick_app/app/jump.service.ts
@@ -8,6 +8,8 @@ import {coreLib} from "./wasm";
import {FeatureSearchService} from "./feature.search.service";
import {SidePanelService, SidePanelState} from "./sidepanel.service";
import {HighlightMode} from "build/libs/core/erdblick-core";
+import {InspectionService} from "./inspection.service";
+import {RightClickMenuService} from "./rightclickmenu.service";
export interface SearchTarget {
icon: string;
@@ -46,6 +48,8 @@ export class JumpTargetService {
private mapService: MapService,
private messageService: InfoMessageService,
private sidePanelService: SidePanelService,
+ private inspectionService: InspectionService,
+ private menuService: RightClickMenuService,
private searchService: FeatureSearchService) {
this.httpClient.get("/config.json", {responseType: 'json'}).subscribe({
next: (data: any) => {
@@ -108,6 +112,124 @@ export class JumpTargetService {
}
}
+ validateMapgetTileId(value: string) {
+ return value.length > 0 && !/\s/g.test(value.trim()) && !isNaN(+value.trim());
+ }
+
+ parseMapgetTileId(value: string): number[] | undefined {
+ if (!value) {
+ this.messageService.showError("No value provided!");
+ return;
+ }
+ try {
+ let wgs84TileId = BigInt(value);
+ let position = coreLib.getTilePosition(wgs84TileId);
+ return [position.x, position.y, position.z]
+ } catch (e) {
+ this.messageService.showError("Possibly malformed TileId: " + (e as Error).message.toString());
+ }
+ return undefined;
+ }
+
+ getInspectTileSourceDataTarget() {
+ const searchString = this.targetValueSubject.getValue();
+ let label = "tileId = ? | (mapId = ?) | (sourceLayerId = ?)";
+
+ const matchSourceDataElements = (value: string) => {
+ const regex = /^\s*(\d+)\s*(?:[,\s;]+)?\s*([^\s,;]*)\s*(?:[,\s;]+)?\s*([^\s,;]*)?\s*$/;
+ const match = value.match(regex);
+ let tileId: bigint | null = null;
+ let mapId = null;
+ let sourceLayerId = null;
+ let valid = true;
+
+ if (match) {
+ const [_, bigintStr, str1, str2] = match;
+ try {
+ tileId = BigInt(bigintStr);
+ valid = this.validateMapgetTileId(tileId.toString());
+ } catch {
+ valid = false;
+ }
+
+ // TODO: check whether the mapId and layerId are valid
+ if (str1) {
+ mapId = str1;
+ }
+ if (str2) {
+ sourceLayerId = str2;
+ }
+ } else {
+ valid = false;
+ }
+
+ if (!tileId || !valid) {
+ return null;
+ }
+
+
+
+ return [tileId, mapId, sourceLayerId]
+ }
+
+ const matches = matchSourceDataElements(searchString);
+ if (matches) {
+ const [tileId, mapId, sourceLayerId] = matches;
+ if (tileId) {
+ label = `tileId = ${tileId}`;
+ if (mapId) {
+ label = `${label} | mapId = ${mapId}`;
+ if (sourceLayerId) {
+ label = `${label} | sourceLayerId = ${sourceLayerId}`;
+ } else {
+ label = `${label} | (sourceLayerId = ?)`;
+ }
+ } else {
+ label = `${label} | (mapId = ?) | (sourceLayerId = ?)`
+ }
+ } else {
+ label += `
Insufficient parameters`;
+ }
+ }
+
+ return {
+ icon: "pi-database",
+ color: "red",
+ name: "Inspect Mapget Tile",
+ label: label,
+ enabled: false,
+ execute: (value: string) => {
+ const matches = matchSourceDataElements(value);
+ if (matches) {
+ const [tileId, mapId, sourceLayerId] = matches;
+ try {
+ if (tileId) {
+ if (mapId) {
+ if (sourceLayerId) {
+ this.inspectionService.loadSourceDataInspection(
+ Number(tileId),
+ String(mapId),
+ String(sourceLayerId)
+ )
+ } else {
+ this.menuService.customTileAndMapId.next([String(tileId), String(mapId)]);
+ }
+ } else {
+ this.menuService.customTileAndMapId.next([String(tileId), ""]);
+ }
+ }
+ } catch (e) {
+ this.messageService.showError(String(e));
+ }
+ }
+ },
+ validate: (value: string) => {
+ const matches = matchSourceDataElements(value);
+ return matches && matches.length && matches[0];
+ }
+ }
+ }
+
update() {
let featureJumpTargets = this.mapService.tileParser?.filterFeatureJumpTargets(this.targetValueSubject.getValue());
let featureJumpTargetsConverted = [];
@@ -123,7 +245,12 @@ export class JumpTargetService {
name: `Jump to ${fjt.name}`,
label: label,
enabled: !fjt.error,
- execute: (_: string) => { this.highlightByJumpTarget(fjt).then(); },
+ execute: (_: string) => {
+ if (fjt.name.toLowerCase().includes("tileid")) {
+
+ }
+ this.highlightByJumpTarget(fjt).then();
+ },
validate: (_: string) => { return !fjt.error; },
}
});
@@ -131,6 +258,7 @@ export class JumpTargetService {
this.jumpTargets.next([
this.getFeatureMatchTarget(),
+ this.getInspectTileSourceDataTarget(),
...featureJumpTargetsConverted,
...this.extJumpTargets
]);
diff --git a/erdblick_app/app/map.service.ts b/erdblick_app/app/map.service.ts
index df9e8062..57c9d831 100644
--- a/erdblick_app/app/map.service.ts
+++ b/erdblick_app/app/map.service.ts
@@ -92,7 +92,6 @@ export class MapService {
private tileVisualizationQueue: [string, TileVisualization][];
private selectionVisualizations: TileVisualization[];
private hoverVisualizations: TileVisualization[];
- private specialTileBorderColourForTiles: [bigint, Color] = [-1n, Color.TRANSPARENT];
tileParser: TileLayerParser|null = null;
tileVisualizationTopic: Subject;
@@ -428,10 +427,6 @@ export class MapService {
return false;
}
tileVisu.showTileBorder = this.getMapLayerBorderState(mapName, layerName);
- if (this.specialTileBorderColourForTiles[0] == tileVisu.tile.tileId) {
- tileVisu.showTileBorder = true;
- tileVisu.specialBorderColour = this.specialTileBorderColourForTiles[1];
- }
tileVisu.isHighDetail = this.currentHighDetailTileIds.has(tileVisu.tile.tileId) || tileVisu.tile.preventCulling;
return true;
});
@@ -810,9 +805,4 @@ export class MapService {
}
}
}
-
- setSpecialTileBorder(tileId: bigint, color: Color) {
- this.specialTileBorderColourForTiles = [tileId, color];
- this.update();
- }
}
diff --git a/erdblick_app/app/parameters.service.ts b/erdblick_app/app/parameters.service.ts
index 84851dee..b4dfa3a0 100644
--- a/erdblick_app/app/parameters.service.ts
+++ b/erdblick_app/app/parameters.service.ts
@@ -499,10 +499,11 @@ export class ParametersService {
this.saveHistoryStateValue(value);
}
}
+ console.log(value);
this.p().search = value ? value : [];
this._replaceUrl = false;
- this.parameters.next(this.p())
this.lastSearchHistoryEntry.next(value);
+ this.parameters.next(this.p())
}
private saveHistoryStateValue(value: [number, string]) {
diff --git a/erdblick_app/app/rightclickmenu.service.ts b/erdblick_app/app/rightclickmenu.service.ts
index 63a93bfd..e2f9857b 100644
--- a/erdblick_app/app/rightclickmenu.service.ts
+++ b/erdblick_app/app/rightclickmenu.service.ts
@@ -2,6 +2,7 @@ import {Injectable} from "@angular/core";
import {MenuItem} from "primeng/api";
import {BehaviorSubject, Subject} from "rxjs";
import {InspectionService} from "./inspection.service";
+import {Entity} from "./cesium";
export interface SourceDataDropdownOption {
id: bigint | string,
@@ -12,26 +13,30 @@ export interface SourceDataDropdownOption {
@Injectable()
export class RightClickMenuService {
- menuItems: MenuItem[];
+ menuItems: BehaviorSubject