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