Add getScaledValue function
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2020-04-07 09:43:54 +02:00
parent dd138f1168
commit d6c89c7ada
3 changed files with 10 additions and 2 deletions

View File

@ -34,4 +34,12 @@ export class ItemListItemComponent extends AbstractItemListItemComponent {
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService) {
super(store, itemTypeService);
}
getScaledValue(value:number,scale:number = 0):number {
let v = value;
if(scale && scale != 0) {
v=scale*value;
}
return v;
}
}

View File

@ -15,7 +15,7 @@
</tr>
<tr *ngFor="let entry of layer.renderer.colorMap.entries; let i = index ">
<td class="legend-items"><span [style.background-color]="getHex(entry.color)" class="color"></span></td>
<td class="legend-items-text"><span *ngIf="!entry.label">{{getValue(entry.value,layer.scale) | number:'1.0-2'}} {{legendunit}}</span><span *ngIf="entry.label">{{entry.label}}</span></td>
<td class="legend-items-text"><span *ngIf="!entry.label">{{getScaledValue(entry.value,layer.scale) | number:'1.0-2'}} {{legendunit}}</span><span *ngIf="entry.label">{{entry.label}}</span></td>
<td class="histogram-items">
<div *ngIf="showHistogram()">
<span class="bar" [style.background-color]="getHex(entry.color)" [style.width]="getPart(layer.renderer, i)">

View File

@ -65,7 +65,7 @@ export class LegendComponent implements OnInit,AfterViewInit {
return part;
}
public getValue(value:number,scale:number):number {
public getScaledValue(value:number,scale:number):number {
let v = value;
if(scale && scale != 0) {
v=scale*value;