Fix layer index
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2020-05-26 17:04:44 +02:00
parent 3ed68efab7
commit 705d811832
4 changed files with 13 additions and 11 deletions

View File

@ -9,19 +9,19 @@
<div class="legend-container" *ngIf="item?.data.layers;let layers">
<div class="card menu-card">
<div *ngIf="layers.length>1">
<select (change)="onLayerChanged($event.target.value)" [value]="itemLayer.layerIndex">
<select (change)="onLayerChanged($event.target.value)" [value]="selectedLayer">
<option *ngFor="let l of layers;" [value]="l.index">{{l.name}}</option>
</select>
</div>
<fm-map-layer-legend [layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
<fm-map-layer-legend [layer]="layer(layers,selectedLayer)" [histogramenabled]="true"></fm-map-layer-legend>
</div>
</div>
<div class="card menu-card">
<ul class="p-0 mt-2">
<li *ngIf="item.isEditable"><a href="#" class="mt-1 mr-1" (click)="handleOnEdit(item)"><i class="fa fa-pencil" aria-hidden="true" i18n-title title="Edit"></i>&nbsp;<span i18n>Edit</span></a></li>
<ng-container *ngIf="itemTypeService.isLayer(item)">
<li *ngIf="!getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)"><i class="fa fa-eye" aria-hidden="true" i18n-title title="Add as layer"></i>&nbsp;<span i18n>Add as overlay</span></a></li>
<li *ngIf="getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)"><i class="fa fa-eye" aria-hidden="true" i18n-title title="Remove overlay"></i>&nbsp;<span i18n>Remove overlay</span></a></li>
<li *ngIf="!getItemLayer(item,selectedLayer)"><a href="#" (click)="handleAddAsLayer(item,selectedLayer)"><i class="fa fa-eye" aria-hidden="true" i18n-title title="Add as layer"></i>&nbsp;<span i18n>Add as overlay</span></a></li>
<li *ngIf="getItemLayer(item,selectedLayer)"><a href="#" (click)="handleRemoveLayer(item,selectedLayer)"><i class="fa fa-eye" aria-hidden="true" i18n-title title="Remove overlay"></i>&nbsp;<span i18n>Remove overlay</span></a></li>
</ng-container>
</ul>
</div>

View File

@ -9,19 +9,19 @@
<div class="legend-container" *ngIf="item?.data.layers;let layers">
<div class="card menu-card">
<div *ngIf="layers.length>1">
<select (change)="onLayerChanged($event.target.value)" [value]="itemLayer.layerIndex">
<select (change)="onLayerChanged($event.target.value)" [value]="selectedLayer">
<option *ngFor="let l of layers;" [value]="l.index">{{l.name}}</option>
</select>
</div>
<fm-map-layer-legend [showTitle]="layers.length==1" [layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
<fm-map-layer-legend [showTitle]="layers.length==1" [layer]="layer(layers,selectedLayer)" [histogramenabled]="true"></fm-map-layer-legend>
</div>
</div>
<div class="card menu-card">
<ul class="p-0 mt-2">
<li *ngIf="item.isEditable"><a href="#" class="mt-1 mr-1" (click)="handleOnEdit(item)" ><i class="fa fa-pencil" aria-hidden="true" i18n-title title="Edit"></i>&nbsp;<span i18n>Edit</span></a></li>
<ng-container *ngIf="itemTypeService.isLayer(item)">
<li *ngIf="!getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)" ><i class="fa fa-eye" aria-hidden="true" i18n-title title="Add as layer"></i>&nbsp;<span i18n>Add as overlay</span></a></li>
<li *ngIf="getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)" ><i class="fa fa-eye" aria-hidden="true" i18n-title title="Remove overlay"></i>&nbsp;<span i18n>Remove overlay</span></a></li>
<li *ngIf="!getItemLayer(item,selectedLayer)"><a href="#" (click)="handleAddAsLayer(item,selectedLayer)" ><i class="fa fa-eye" aria-hidden="true" i18n-title title="Add as layer"></i>&nbsp;<span i18n>Add as overlay</span></a></li>
<li *ngIf="getItemLayer(item,selectedLayer)"><a href="#" (click)="handleRemoveLayer(item,selectedLayer)" ><i class="fa fa-eye" aria-hidden="true" i18n-title title="Remove overlay"></i>&nbsp;<span i18n>Remove overlay</span></a></li>
</ng-container>
</ul>
</div>

View File

@ -23,8 +23,10 @@ export class SelectedItemShapeComponent extends AbstractSelectedItemComponent {
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
super(store, itemTypeService,location,router);
}
public selectedLayer: number = 0;
onLayerChanged(layerIndex: number) {
this.selectedLayer = layerIndex;
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
}

View File

@ -1,9 +1,9 @@
{
"issuer": "https://accounts.farmmaps.awacc.nl",
"issuer": "https://accounts.farmmaps.awtest.nl",
"clientId": "farmmapsdev",
"audience": "https://farmmaps.awacc.nl/",
"audience": "https://farmmaps.awtest.nl/",
"requireHttps": true,
"apiEndPoint": "https://farmmaps.awacc.nl",
"apiEndPoint": "https://farmmaps.awtest.nl",
"grantType":"code"
}