| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- 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);
- }
- }
- }
|