Add getScaledValue function
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
dd138f1168
commit
d6c89c7ada
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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)">
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user