From 55e0fca470b4278bd1d79ee5eb19c657f5e83e17 Mon Sep 17 00:00:00 2001 From: Fabian Jeglinski Date: Sun, 8 Sep 2019 12:13:30 +0200 Subject: [PATCH] add todos; add public accessors --- .../feature-manager.component.html | 17 ----------------- .../feature-manager.component.ts | 2 +- src/app/map/map.component.ts | 19 +++++++++++++------ 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/app/feature-management/feature-manager/feature-manager.component.html b/src/app/feature-management/feature-manager/feature-manager.component.html index 1fb95d1..d4facf0 100644 --- a/src/app/feature-management/feature-manager/feature-manager.component.html +++ b/src/app/feature-management/feature-manager/feature-manager.component.html @@ -6,27 +6,10 @@ {{item.key}}
{{item.value}} -
- edit - delete -

Custom Properties

- - - - - - - - - -
- - -
diff --git a/src/app/feature-management/feature-manager/feature-manager.component.ts b/src/app/feature-management/feature-manager/feature-manager.component.ts index 9568bc6..945fa19 100644 --- a/src/app/feature-management/feature-manager/feature-manager.component.ts +++ b/src/app/feature-management/feature-manager/feature-manager.component.ts @@ -7,7 +7,7 @@ import {RawLayer} from 'src/app/models/RawLayer'; /** * This component manages all properties of the current feature. It does not matter if it is a simple geo json * property or a custom property (custom properties are special properties that are just understand by life map - * like color of the feature). All changes that were made to the properties are saved in the geo json of + * like the color of the feature). All changes that were made to the properties are saved in the geo json of * the RawLayer object from which the open layer feature based. */ @Component({ diff --git a/src/app/map/map.component.ts b/src/app/map/map.component.ts index 9757dd8..639ffdb 100644 --- a/src/app/map/map.component.ts +++ b/src/app/map/map.component.ts @@ -21,6 +21,13 @@ import {FeatureManagerComponent} from '../feature-management/feature-manager/fea /** * TODO: add description + * + * TODO + * - The order of the layers inside the layer menu does not reflect the real order on the map + * - define the data structure to create for use on mobile devices + * - define how the color format should look like to use it with mapbox + * - extend feature manager to handle many properties + * - design? */ @Component({ selector: 'app-map', @@ -237,7 +244,7 @@ export class MapComponent implements OnInit { /** * Opens a dialog to create a new custom layer */ - addLayer(): void { + public addLayer(): void { const dialogRef = this.dialog.open(AddLayerComponent); dialogRef.afterClosed().subscribe(rawLayer => { if (rawLayer) { @@ -252,7 +259,7 @@ export class MapComponent implements OnInit { /** * Opens a dialog to edit a custom layer */ - editLayer(index: number): void { + public editLayer(index: number): void { const vectorLayer = this.customLayerCollection.item(index); const rawLayer = RawLayer.fromVectorLayer(vectorLayer); const dialogRef = this.dialog.open(AddLayerComponent, {data: rawLayer}); @@ -273,7 +280,7 @@ export class MapComponent implements OnInit { * Updates the customLayer collection according to drag and drop actions. * @param event */ - drop(event: CdkDragDrop) { + public drop(event: CdkDragDrop) { const tmp = this.customLayerCollection.item(event.previousIndex); this.customLayerCollection.removeAt(event.previousIndex); this.customLayerCollection.insertAt(event.currentIndex, tmp); @@ -283,7 +290,7 @@ export class MapComponent implements OnInit { * Deletes a layer from custom layer collection * @param layer */ - deleteLayer(layer: VectorLayer) { + public deleteLayer(layer: VectorLayer) { this.customLayerCollection.remove(layer); } @@ -291,11 +298,11 @@ export class MapComponent implements OnInit { * Toggles the visibility of a custom layer * @param index */ - toggleLayerVisibility(layer: VectorLayer) { + public toggleLayerVisibility(layer: VectorLayer) { layer.setVisible(!layer.getVisible()); } - saveLayers(): RawLayer[] { + public saveLayers(): RawLayer[] { const rawLayers = []; this.customLayerCollection.forEach(layer => rawLayers.push(RawLayer.fromVectorLayer(layer))); return rawLayers;