|
|
@@ -7,8 +7,10 @@ import {
|
|
|
HsLayoutService,
|
|
|
// eslint-disable-next-line import/named
|
|
|
HsPanelComponent,
|
|
|
+ HsSidebarService,
|
|
|
} from 'hslayers-ng';
|
|
|
|
|
|
+import {AppService} from '../app.service';
|
|
|
import {FcCalculatorService, Index} from './calculator.service';
|
|
|
import {FcFieldService} from './field.service';
|
|
|
|
|
|
@@ -31,7 +33,9 @@ export class FcCalculatorComponent implements HsPanelComponent, OnInit {
|
|
|
public calcService: FcCalculatorService,
|
|
|
private fieldService: FcFieldService,
|
|
|
public hsLanguageService: HsLanguageService,
|
|
|
- public hsLayoutService: HsLayoutService
|
|
|
+ public hsLayoutService: HsLayoutService,
|
|
|
+ private hsSidebarService: HsSidebarService,
|
|
|
+ private appService: AppService
|
|
|
) {
|
|
|
this.fieldService.fieldSelects.subscribe(({features}) => {
|
|
|
this.data.selectedFieldsProperties = [];
|
|
|
@@ -50,6 +54,21 @@ export class FcCalculatorComponent implements HsPanelComponent, OnInit {
|
|
|
|
|
|
ngOnInit() {
|
|
|
this.data.selectedProduct = null;
|
|
|
+ this.hsSidebarService.addButton(
|
|
|
+ {
|
|
|
+ panel: 'calculator',
|
|
|
+ module: 'calculator',
|
|
|
+ order: 0,
|
|
|
+ fits: true,
|
|
|
+ visible: true,
|
|
|
+ title: 'Field Calculator', //() =>
|
|
|
+ //this.hsLanguageService.getTranslation('ADJUSTER.adjustFactors'),
|
|
|
+ description: 'Adjust factors for computation',
|
|
|
+ icon: 'icon-analytics-piechart',
|
|
|
+ },
|
|
|
+ 'default'
|
|
|
+ );
|
|
|
+ this.appService.init();
|
|
|
this.calcService.addLayersFromComposition(
|
|
|
'https://www.agrihub.cz/rest/hana_kubickova92/maps/voda',
|
|
|
{path: 'Voda'}
|