add todos; add public accessors

This commit is contained in:
Fabian Jeglinski
2019-09-08 12:13:30 +02:00
parent 240d0c9997
commit 55e0fca470
3 changed files with 14 additions and 24 deletions
@@ -6,27 +6,10 @@
{{item.key}}
<br>
{{item.value}}
<div class="controls">
<i class="material-icons">edit</i>
<i class="material-icons">delete</i>
</div>
</div>
<div class="header">
<h4>Custom Properties</h4>
</div>
<!--<div *ngFor="let item of curCustomProperties | keyvalue" class="entry">-->
<!-- {{item.key}}-->
<!-- <br>-->
<!-- {{item.value}}-->
<!-- <div class="controls">-->
<!-- <i class="material-icons">edit</i>-->
<!-- <i class="material-icons">delete</i>-->
<!-- </div>-->
<!--</div>-->
<lm-custom-color-entry [colors]="curFeatureColors"
(colorChanged)="onFeatureColorChanged($event)"></lm-custom-color-entry>
<div class="button-container">
<button>Abbrechen</button>
<button>Speichern</button>
</div>
</div>
@@ -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({
+13 -6
View File
@@ -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<RawLayer[]>) {
public drop(event: CdkDragDrop<RawLayer[]>) {
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;