|
@@ -1,6 +1,5 @@
|
|
|
import {Component} from '@angular/core';
|
|
import {Component} from '@angular/core';
|
|
|
|
|
|
|
|
-import {GeoJSON} from 'ol/format';
|
|
|
|
|
import {OSM, TileWMS, Vector as VectorSource} from 'ol/source';
|
|
import {OSM, TileWMS, Vector as VectorSource} from 'ol/source';
|
|
|
import {Tile, Vector as VectorLayer} from 'ol/layer';
|
|
import {Tile, Vector as VectorLayer} from 'ol/layer';
|
|
|
import {View} from 'ol';
|
|
import {View} from 'ol';
|
|
@@ -16,6 +15,7 @@ import {
|
|
|
} from 'hslayers-ng';
|
|
} from 'hslayers-ng';
|
|
|
|
|
|
|
|
import {IrrigationForecastPanelComponent} from './irrigation/irrigation-forecast-panel.component';
|
|
import {IrrigationForecastPanelComponent} from './irrigation/irrigation-forecast-panel.component';
|
|
|
|
|
+import {IrrigationHistoryService} from './irrigation/irrigation-history.service';
|
|
|
import {ReservoirHistoryPanelComponent} from './irrigation/reservoir-history-panel.component';
|
|
import {ReservoirHistoryPanelComponent} from './irrigation/reservoir-history-panel.component';
|
|
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
@@ -34,7 +34,8 @@ export class HslayersAppComponent {
|
|
|
private hsLayoutService: HsLayoutService,
|
|
private hsLayoutService: HsLayoutService,
|
|
|
private hsPanelContainerService: HsPanelContainerService,
|
|
private hsPanelContainerService: HsPanelContainerService,
|
|
|
private hsSidebarService: HsSidebarService,
|
|
private hsSidebarService: HsSidebarService,
|
|
|
- private hsToastService: HsToastService
|
|
|
|
|
|
|
+ private hsToastService: HsToastService,
|
|
|
|
|
+ private irrigationHistoryService: IrrigationHistoryService
|
|
|
) {
|
|
) {
|
|
|
/* Create new button in the sidebar */
|
|
/* Create new button in the sidebar */
|
|
|
this.hsSidebarService.buttons.push(
|
|
this.hsSidebarService.buttons.push(
|
|
@@ -77,6 +78,15 @@ export class HslayersAppComponent {
|
|
|
}),
|
|
}),
|
|
|
visible: true,
|
|
visible: true,
|
|
|
});
|
|
});
|
|
|
|
|
+ const reservoirWfsLayer = new VectorLayer({
|
|
|
|
|
+ properties: {
|
|
|
|
|
+ title: `Water level at ${this.irrigationHistoryService.timeStamp}`,
|
|
|
|
|
+ base: false,
|
|
|
|
|
+ removable: false,
|
|
|
|
|
+ inlineLegend: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ source: this.irrigationHistoryService.reservoirWfsSource,
|
|
|
|
|
+ });
|
|
|
/* Define the polygon's style using SLD */
|
|
/* Define the polygon's style using SLD */
|
|
|
const polygonSld = `<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
const polygonSld = `<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
<StyledLayerDescriptor version="1.0.0"
|
|
<StyledLayerDescriptor version="1.0.0"
|
|
@@ -160,8 +170,9 @@ export class HslayersAppComponent {
|
|
|
removable: false,
|
|
removable: false,
|
|
|
},
|
|
},
|
|
|
}),
|
|
}),
|
|
|
- /* One thematic layer */
|
|
|
|
|
|
|
+ /* Two thematic layers */
|
|
|
reservoirWmsLayer,
|
|
reservoirWmsLayer,
|
|
|
|
|
+ reservoirWfsLayer,
|
|
|
],
|
|
],
|
|
|
default_view: new View({
|
|
default_view: new View({
|
|
|
center: transform([18.308, 48.147], 'EPSG:4326', 'EPSG:3857'),
|
|
center: transform([18.308, 48.147], 'EPSG:4326', 'EPSG:3857'),
|