fix for statistics
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
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()"> <tr *ngIf="showHistogram()">
<td colspan="4" class="pb-1 pt-1"> <td colspan="4" class="pb-1 pt-1">
<div class="info" [ngbCollapse]="hideHistogramDetails"> <div class="info" [ngbCollapse]="hideHistogramDetails">
<fm-map-histogram-details *ngIf="bandContainsHistogram(); else statistics" <ng-container *ngIf="bandContainsStatistics(); else histogram">
[histogram]="layer.renderer.band.histogram"></fm-map-histogram-details>
<ng-template #statistics>
<fm-map-statistics-details [statistics]="layer.renderer.band.statistics"></fm-map-statistics-details> <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> </ng-template>
</div> </div>
</td> </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"; 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 { bandContainsStatistics(): boolean {
return this.layer.renderer.band.histogram != null; return this.layer.renderer.band.statistics != null;
} }
} }

View File

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