Fix legend
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma 2020-03-03 19:43:17 +01:00
parent 2388968f2a
commit 0621b32fba
6 changed files with 15 additions and 3 deletions

View File

@ -13,7 +13,7 @@
<option *ngFor="let l of layers;" [value]="l.index">{{l.name}}</option>
</select>
</div>
<fm-map-layer-legend [layer]="layers[itemLayer.layerIndex]" [histogramenabled]="true"></fm-map-layer-legend>
<fm-map-layer-legend [layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
</div>
</div>
<div class="card menu-card">

View File

@ -27,4 +27,8 @@ export class SelectedItemGeotiffComponent extends AbstractSelectedItemComponent
this.selectedLayer = layerIndex;
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
}
layer(layers:any,layerIndex:number) {
return layers.find(l => l.index == layerIndex);
}
}

View File

@ -13,7 +13,7 @@
<option *ngFor="let l of layers;" [value]="l.index">{{l.name}}</option>
</select>
</div>
<fm-map-layer-legend [showTitle]="layers.length==1" [layer]="layers[itemLayer.layerIndex]" [histogramenabled]="true"></fm-map-layer-legend>
<fm-map-layer-legend [showTitle]="layers.length==1" [layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
</div>
</div>
<div class="card menu-card">

View File

@ -27,4 +27,8 @@ export class SelectedItemShapeComponent extends AbstractSelectedItemComponent {
onLayerChanged(layerIndex: number) {
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
}
layer(layers:any,layerIndex:number) {
return layers.find(l => l.index == layerIndex);
}
}

View File

@ -14,7 +14,7 @@
<option *ngFor="let l of layers;" [value]="l.index">{{l.name}}</option>
</select>
</div>
<fm-map-layer-legend [layer]="layers[itemLayer.layerIndex]" [histogramenabled]="true"></fm-map-layer-legend>
<fm-map-layer-legend [layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
</div>
</div>
<div class="card menu-card">

View File

@ -68,4 +68,8 @@ export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent
}
return null;
}
layer(layers:any,layerIndex:number) {
return layers.find(l => l.index == layerIndex);
}
}