|
@@ -6,7 +6,17 @@ import {Tile, Vector as VectorLayer} from 'ol/layer';
|
|
|
import {View} from 'ol';
|
|
import {View} from 'ol';
|
|
|
import {transform} from 'ol/proj';
|
|
import {transform} from 'ol/proj';
|
|
|
|
|
|
|
|
-import {HsConfig, HsEventBusService, HsToastService} from 'hslayers-ng';
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ HsConfig,
|
|
|
|
|
+ HsEventBusService,
|
|
|
|
|
+ HsLayoutService,
|
|
|
|
|
+ HsPanelContainerService,
|
|
|
|
|
+ HsSidebarService,
|
|
|
|
|
+ HsToastService,
|
|
|
|
|
+} from 'hslayers-ng';
|
|
|
|
|
+
|
|
|
|
|
+import {IrrigationForecastPanelComponent} from './irrigation/irrigation-forecast-panel.component';
|
|
|
|
|
+import {ReservoirHistoryPanelComponent} from './irrigation/reservoir-history-panel.component';
|
|
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
|
selector: 'application-root',
|
|
selector: 'application-root',
|
|
@@ -20,14 +30,44 @@ export class HslayersAppComponent {
|
|
|
constructor(
|
|
constructor(
|
|
|
/* Inject here all modules from HSLayers-NG which you intend to use */
|
|
/* Inject here all modules from HSLayers-NG which you intend to use */
|
|
|
public hsConfig: HsConfig,
|
|
public hsConfig: HsConfig,
|
|
|
- private hsEventBusService: HsEventBusService,
|
|
|
|
|
|
|
+ private hsEventBus: HsEventBusService,
|
|
|
|
|
+ private hsLayoutService: HsLayoutService,
|
|
|
|
|
+ private hsPanelContainerService: HsPanelContainerService,
|
|
|
|
|
+ private hsSidebarService: HsSidebarService,
|
|
|
private hsToastService: HsToastService
|
|
private hsToastService: HsToastService
|
|
|
) {
|
|
) {
|
|
|
|
|
+ /* Create new button in the sidebar */
|
|
|
|
|
+ this.hsSidebarService.buttons.push(
|
|
|
|
|
+ {
|
|
|
|
|
+ panel: 'history',
|
|
|
|
|
+ module: 'history',
|
|
|
|
|
+ order: 1,
|
|
|
|
|
+ title: 'Reservoir history',
|
|
|
|
|
+ description: 'Show history of the irrigation',
|
|
|
|
|
+ icon: 'icon-calendarthree',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ panel: 'forecast',
|
|
|
|
|
+ module: 'forecast',
|
|
|
|
|
+ order: 1,
|
|
|
|
|
+ title: 'Irrigation forecast',
|
|
|
|
|
+ description: 'Show forecast of the irrigation',
|
|
|
|
|
+ icon: 'icon-sun-day',
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ /* Create new panel itself */
|
|
|
|
|
+ this.hsPanelContainerService.create(ReservoirHistoryPanelComponent, {});
|
|
|
|
|
+ this.hsPanelContainerService.create(IrrigationForecastPanelComponent, {});
|
|
|
|
|
+ /* Switch panel */
|
|
|
|
|
+ /*this.hsEventBus.layoutLoads.subscribe(() => {
|
|
|
|
|
+ this.hsLayoutService.setDefaultPanel('history');
|
|
|
|
|
+ });*/
|
|
|
const reservoirWmsLayer = new Tile({
|
|
const reservoirWmsLayer = new Tile({
|
|
|
properties: {
|
|
properties: {
|
|
|
title: 'Current water level',
|
|
title: 'Current water level',
|
|
|
base: false,
|
|
base: false,
|
|
|
removable: false,
|
|
removable: false,
|
|
|
|
|
+ inlineLegend: true,
|
|
|
},
|
|
},
|
|
|
source: new TileWMS({
|
|
source: new TileWMS({
|
|
|
url: 'https://www.gis.atapex.sk/geoserver/agrihub/wms',
|
|
url: 'https://www.gis.atapex.sk/geoserver/agrihub/wms',
|
|
@@ -88,13 +128,17 @@ export class HslayersAppComponent {
|
|
|
useProxy: false,
|
|
useProxy: false,
|
|
|
panelsEnabled: {
|
|
panelsEnabled: {
|
|
|
composition_browser: false,
|
|
composition_browser: false,
|
|
|
|
|
+ datasource_selector: false,
|
|
|
|
|
+ addData: false,
|
|
|
|
|
+ info: false,
|
|
|
saveMap: false,
|
|
saveMap: false,
|
|
|
language: false,
|
|
language: false,
|
|
|
|
|
+ legend: false,
|
|
|
draw: false,
|
|
draw: false,
|
|
|
permalink: false,
|
|
permalink: false,
|
|
|
},
|
|
},
|
|
|
componentsEnabled: {
|
|
componentsEnabled: {
|
|
|
- basemapGallery: true,
|
|
|
|
|
|
|
+ basemapGallery: false,
|
|
|
},
|
|
},
|
|
|
assetsPath: 'assets',
|
|
assetsPath: 'assets',
|
|
|
symbolizerIcons: [
|
|
symbolizerIcons: [
|
|
@@ -129,7 +173,7 @@ export class HslayersAppComponent {
|
|
|
zoomWithModifierKeyOnly: false,
|
|
zoomWithModifierKeyOnly: false,
|
|
|
});
|
|
});
|
|
|
/* Now wait for the OpenLayers Map object to load */
|
|
/* Now wait for the OpenLayers Map object to load */
|
|
|
- // this.hsEventBusService.olMapLoads.subscribe(() => {
|
|
|
|
|
|
|
+ // this.hsEventBus.olMapLoads.subscribe(() => {
|
|
|
// /* ...and display a simple toast message in the bottom-left corner */
|
|
// /* ...and display a simple toast message in the bottom-left corner */
|
|
|
// this.hsToastService.createToastPopupMessage(
|
|
// this.hsToastService.createToastPopupMessage(
|
|
|
// 'READY!',
|
|
// 'READY!',
|