|
|
@@ -7,6 +7,7 @@ import {HsConfig} from 'hslayers-ng';
|
|
|
|
|
|
import {FieldService} from './field.service';
|
|
|
import {ZonesService} from './zones.service';
|
|
|
+import {imageWmsTLayer, imageWmsTSource} from './image-wms-t-layer';
|
|
|
|
|
|
export type Index = 'EVI' | 'RVI4S1';
|
|
|
|
|
|
@@ -121,6 +122,7 @@ export class CalculatorService {
|
|
|
console.log(data);
|
|
|
this._zonesLoading = false;
|
|
|
this.zonesService.updateZones(data, {quantileCount: this.quantileCount});
|
|
|
+ this.updateImageBackground(this.selectedDate);
|
|
|
} catch (err) {
|
|
|
this._zonesLoading = false;
|
|
|
console.error('Somethin fucked up!');
|
|
|
@@ -128,6 +130,16 @@ export class CalculatorService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Updates WMS-t layer with the source image
|
|
|
+ * @param date - ISO date
|
|
|
+ */
|
|
|
+ updateImageBackground(date: string) {
|
|
|
+ const isoTime = date.split('T')[0].replace(/-/g, '');
|
|
|
+ imageWmsTSource.updateParams({time: isoTime});
|
|
|
+ imageWmsTLayer.setVisible(true);
|
|
|
+ }
|
|
|
+
|
|
|
private proxyEnabled(): boolean {
|
|
|
return this.hsConfig.useProxy === undefined || this.hsConfig.useProxy;
|
|
|
}
|