add todos; add public accessors
This commit is contained in:
@@ -6,27 +6,10 @@
|
|||||||
{{item.key}}
|
{{item.key}}
|
||||||
<br>
|
<br>
|
||||||
{{item.value}}
|
{{item.value}}
|
||||||
<div class="controls">
|
|
||||||
<i class="material-icons">edit</i>
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h4>Custom Properties</h4>
|
<h4>Custom Properties</h4>
|
||||||
</div>
|
</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"
|
<lm-custom-color-entry [colors]="curFeatureColors"
|
||||||
(colorChanged)="onFeatureColorChanged($event)"></lm-custom-color-entry>
|
(colorChanged)="onFeatureColorChanged($event)"></lm-custom-color-entry>
|
||||||
<div class="button-container">
|
|
||||||
<button>Abbrechen</button>
|
|
||||||
<button>Speichern</button>
|
|
||||||
</div>
|
|
||||||
</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
|
* 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
|
* 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.
|
* the RawLayer object from which the open layer feature based.
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ import {FeatureManagerComponent} from '../feature-management/feature-manager/fea
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: add description
|
* 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({
|
@Component({
|
||||||
selector: 'app-map',
|
selector: 'app-map',
|
||||||
@@ -237,7 +244,7 @@ export class MapComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Opens a dialog to create a new custom layer
|
* Opens a dialog to create a new custom layer
|
||||||
*/
|
*/
|
||||||
addLayer(): void {
|
public addLayer(): void {
|
||||||
const dialogRef = this.dialog.open(AddLayerComponent);
|
const dialogRef = this.dialog.open(AddLayerComponent);
|
||||||
dialogRef.afterClosed().subscribe(rawLayer => {
|
dialogRef.afterClosed().subscribe(rawLayer => {
|
||||||
if (rawLayer) {
|
if (rawLayer) {
|
||||||
@@ -252,7 +259,7 @@ export class MapComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Opens a dialog to edit a custom layer
|
* Opens a dialog to edit a custom layer
|
||||||
*/
|
*/
|
||||||
editLayer(index: number): void {
|
public editLayer(index: number): void {
|
||||||
const vectorLayer = this.customLayerCollection.item(index);
|
const vectorLayer = this.customLayerCollection.item(index);
|
||||||
const rawLayer = RawLayer.fromVectorLayer(vectorLayer);
|
const rawLayer = RawLayer.fromVectorLayer(vectorLayer);
|
||||||
const dialogRef = this.dialog.open(AddLayerComponent, {data: rawLayer});
|
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.
|
* Updates the customLayer collection according to drag and drop actions.
|
||||||
* @param event
|
* @param event
|
||||||
*/
|
*/
|
||||||
drop(event: CdkDragDrop<RawLayer[]>) {
|
public drop(event: CdkDragDrop<RawLayer[]>) {
|
||||||
const tmp = this.customLayerCollection.item(event.previousIndex);
|
const tmp = this.customLayerCollection.item(event.previousIndex);
|
||||||
this.customLayerCollection.removeAt(event.previousIndex);
|
this.customLayerCollection.removeAt(event.previousIndex);
|
||||||
this.customLayerCollection.insertAt(event.currentIndex, tmp);
|
this.customLayerCollection.insertAt(event.currentIndex, tmp);
|
||||||
@@ -283,7 +290,7 @@ export class MapComponent implements OnInit {
|
|||||||
* Deletes a layer from custom layer collection
|
* Deletes a layer from custom layer collection
|
||||||
* @param layer
|
* @param layer
|
||||||
*/
|
*/
|
||||||
deleteLayer(layer: VectorLayer) {
|
public deleteLayer(layer: VectorLayer) {
|
||||||
this.customLayerCollection.remove(layer);
|
this.customLayerCollection.remove(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,11 +298,11 @@ export class MapComponent implements OnInit {
|
|||||||
* Toggles the visibility of a custom layer
|
* Toggles the visibility of a custom layer
|
||||||
* @param index
|
* @param index
|
||||||
*/
|
*/
|
||||||
toggleLayerVisibility(layer: VectorLayer) {
|
public toggleLayerVisibility(layer: VectorLayer) {
|
||||||
layer.setVisible(!layer.getVisible());
|
layer.setVisible(!layer.getVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
saveLayers(): RawLayer[] {
|
public saveLayers(): RawLayer[] {
|
||||||
const rawLayers = [];
|
const rawLayers = [];
|
||||||
this.customLayerCollection.forEach(layer => rawLayers.push(RawLayer.fromVectorLayer(layer)));
|
this.customLayerCollection.forEach(layer => rawLayers.push(RawLayer.fromVectorLayer(layer)));
|
||||||
return rawLayers;
|
return rawLayers;
|
||||||
|
|||||||
Reference in New Issue
Block a user