import {Component, ViewRef} from '@angular/core'; import {HsLayoutService} from 'hslayers-ng'; import {HsPanelComponent} from 'hslayers-ng'; import {AdjusterPresetsService} from '../adjuster-presets.service'; import {AdjusterService} from '../adjuster.service'; import {AdjusterUIService} from '../adjuster-ui.service'; import {nuts3IndexLayer} from '../../app.config'; @Component({ selector: 'pra-adjuster-simple', templateUrl: './adjuster-simple-panel.component.html', styleUrls: ['./adjuster-simple-panel.component.scss'], }) export class AdjusterSimplePanelComponent implements HsPanelComponent { name = 'adjuster-simple'; data: any; errorMsg: string; //method: string; viewRef: ViewRef; constructor( public adjUIService: AdjusterUIService, public adjusterPresetsService: AdjusterPresetsService, public adjusterService: AdjusterService, public hsLayoutService: HsLayoutService ) {} isVisible(): boolean { return this.hsLayoutService.panelVisible('adjuster-simple'); } /** * enables index calculation and map layer * disables clusters calculation an map layers */ selectIndex() { /* disable/enable calculation */ this.adjusterService.allowIndex = true; this.adjusterService.allowClusters = false; /* disable/enable map layers */ nuts3IndexLayer.setVisible(true); for (const method of this.adjusterService.methods) { method.layer?.setVisible(false); } } /** * disables index calculation and map layer * enables clusters calculation an map layers */ selectClusters() { /* disable/enable calculation */ this.adjusterService.allowIndex = false; this.adjusterService.allowClusters = true; /* disable/enable map layers */ nuts3IndexLayer.setVisible(false); for (const method of this.adjusterService.methods) { method.layer?.setVisible(true); } } }