diff --git a/CMakeLists.txt b/CMakeLists.txt
index e2083b78..ff48db67 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,7 @@ message("Building for ${CMAKE_SYSTEM_NAME}.")
if (NOT TARGET mapget)
FetchContent_Declare(mapget
GIT_REPOSITORY "https://github.com/Klebert-Engineering/mapget"
- GIT_TAG "v2024.5.0"
+ GIT_TAG "legal-info-entry"
GIT_SHALLOW ON)
FetchContent_MakeAvailable(mapget)
endif()
diff --git a/erdblick_app/app/app.component.ts b/erdblick_app/app/app.component.ts
index 89c07dbe..e2b8f044 100644
--- a/erdblick_app/app/app.component.ts
+++ b/erdblick_app/app/app.component.ts
@@ -18,6 +18,10 @@ import {filter} from "rxjs";
+
+
+ {{ copyright }}
+
{{ title }} {{ version }}
@@ -36,19 +40,25 @@ export class AppComponent {
title: string = "erdblick";
version: string = "";
+ copyright: string = "";
constructor(private httpClient: HttpClient,
private router: Router,
private activatedRoute: ActivatedRoute,
public mapService: MapService,
- public styleService: StyleService,
- public jumpToTargetService: JumpTargetService,
public parametersService: ParametersService) {
this.httpClient.get('./bundle/VERSION', {responseType: 'text'}).subscribe(
data => {
this.version = data.toString();
});
this.init();
+ this.mapService.legalInformationUpdated.subscribe(_ => {
+ this.copyright = "";
+ let firstSet: Set | undefined = this.mapService.legalInformationPerMap.values().next().value;
+ if (firstSet !== undefined && firstSet.size) {
+ this.copyright = '© '.concat(firstSet.values().next().value as string).slice(0, 14).concat('…');
+ }
+ });
}
init() {
@@ -83,4 +93,8 @@ export class AppComponent {
replaceUrl: replaceUrl
});
}
+
+ openLegalInfo() {
+ this.parametersService.legalInfoDialogVisible = true;
+ }
}
diff --git a/erdblick_app/app/app.module.ts b/erdblick_app/app/app.module.ts
index 26c19551..b66fb93c 100644
--- a/erdblick_app/app/app.module.ts
+++ b/erdblick_app/app/app.module.ts
@@ -76,6 +76,7 @@ import {StatsDialogComponent} from "./stats.component";
import {SourceDataLayerSelectionDialogComponent} from "./sourcedataselection.dialog.component";
import {ContextMenuModule} from "primeng/contextmenu";
import {RightClickMenuService} from "./rightclickmenu.service";
+import {LegalInfoDialogComponent} from "./legalinfo.component";
export function initializeServices(styleService: StyleService, mapService: MapService, coordService: CoordinatesService) {
return async () => {
@@ -152,7 +153,8 @@ export function typeValidationMessage({ schemaType }: any) {
HighlightSearch,
TreeTableFilterPatchDirective,
StatsDialogComponent,
- SourceDataLayerSelectionDialogComponent
+ SourceDataLayerSelectionDialogComponent,
+ LegalInfoDialogComponent
],
bootstrap: [
AppComponent
diff --git a/erdblick_app/app/features.model.ts b/erdblick_app/app/features.model.ts
index 318c51a7..8268933b 100644
--- a/erdblick_app/app/features.model.ts
+++ b/erdblick_app/app/features.model.ts
@@ -14,6 +14,7 @@ export class FeatureTile {
mapName: string;
layerName: string;
tileId: bigint;
+ legalInfo: string;
numFeatures: number;
private parser: TileLayerParser;
preventCulling: boolean;
@@ -39,6 +40,7 @@ export class FeatureTile {
this.mapName = mapTileMetadata.mapName;
this.layerName = mapTileMetadata.layerName;
this.tileId = mapTileMetadata.tileId;
+ this.legalInfo = mapTileMetadata.legalInfo;
this.numFeatures = mapTileMetadata.numFeatures;
this.stats.set(FeatureTile.statTileSize, [tileFeatureLayerBlob.length/1024]);
for (let [k, v] of Object.entries(mapTileMetadata.scalarFields)) {
diff --git a/erdblick_app/app/legalinfo.component.ts b/erdblick_app/app/legalinfo.component.ts
new file mode 100644
index 00000000..ed5501b1
--- /dev/null
+++ b/erdblick_app/app/legalinfo.component.ts
@@ -0,0 +1,74 @@
+import { Component } from "@angular/core";
+import { MapService } from "./map.service";
+import { ParametersService } from "./parameters.service";
+
+@Component({
+ selector: 'legal-dialog',
+ template: `
+
+
+
+
+
+ Map Name |
+ Legal Information |
+
+
+
+
+ {{ info.mapName }} |
+ {{ info.entry }} |
+
+
+
+
+
+
+ `,
+ styles: [
+ `
+ .dialog-content {
+ display: flex;
+ flex-direction: column;
+ gap: 1em;
+ }
+ .stats-table {
+ width: 100%;
+ border-collapse: collapse;
+ }
+ .stats-table th, .stats-table td {
+ border: 1px solid #ccc;
+ padding: 0.5em;
+ text-align: left;
+ }
+ .stats-table th {
+ background-color: #f9f9f9;
+ font-weight: bold;
+ }
+ `
+ ]
+})
+export class LegalInfoDialogComponent {
+ public aggregatedLegalInfo: { mapName: string, entry: string }[] = [];
+
+ constructor(private mapService: MapService,
+ public parametersService: ParametersService) {
+ this.mapService.legalInformationUpdated.subscribe(_ => {
+ this.aggregatedLegalInfo = [];
+ this.mapService.legalInformationPerMap.forEach((entries, mapName) => {
+ if (entries.size) {
+ this.aggregatedLegalInfo.push({
+ mapName: mapName,
+ entry: Array.from(entries).join('\n\n')
+ })
+ }
+ });
+ });
+ }
+
+ close() {
+ this.parametersService.legalInfoDialogVisible = false;
+ }
+}
+
diff --git a/erdblick_app/app/map.service.ts b/erdblick_app/app/map.service.ts
index 255327f5..2801f2c5 100644
--- a/erdblick_app/app/map.service.ts
+++ b/erdblick_app/app/map.service.ts
@@ -86,6 +86,8 @@ export class MapService {
public maps: BehaviorSubject