fix for statistics
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good Details

2022.01
Mark van der Wal 2020-07-28 20:02:23 +02:00
parent f014dc9f93
commit 52871efb09
3 changed files with 8 additions and 6 deletions

View File

@ -30,10 +30,12 @@
<tr *ngIf="showHistogram()">
<td colspan="4" class="pb-1 pt-1">
<div class="info" [ngbCollapse]="hideHistogramDetails">
<fm-map-histogram-details *ngIf="bandContainsHistogram(); else statistics"
[histogram]="layer.renderer.band.histogram"></fm-map-histogram-details>
<ng-template #statistics>
<ng-container *ngIf="bandContainsStatistics(); else histogram">
<fm-map-statistics-details [statistics]="layer.renderer.band.statistics"></fm-map-statistics-details>
</ng-container>
<ng-template #histogram>
<fm-map-histogram-details [histogram]="layer.renderer.band.histogram"></fm-map-histogram-details>
</ng-template>
</div>
</td>

View File

@ -88,8 +88,8 @@ export class LegendComponent implements OnInit,AfterViewInit {
return this.histogramenabled && this.layer.renderer.band.histogram.entries && this.layer.renderer.band.histogram.entries.length > 0 && this.layer.renderer.colorMap.colormapType == "minmax";
}
bandContainsHistogram(): boolean {
return this.layer.renderer.band.histogram != null;
bandContainsStatistics(): boolean {
return this.layer.renderer.band.statistics != null;
}
}

View File

@ -58,7 +58,7 @@ export interface IColorMap {
export interface IBand {
histogram: IHistogram;
statistics?: IStatistics;
statistics: IStatistics;
}