Skip to content

Measure panel

Dailis edited this page Oct 12, 2021 · 5 revisions

Measurement

Enable/disable

import {HsConfig} from 'hslayers-ng';
@Component({
  selector: 'your-app-component',
  templateUrl: 'your-app-component.html',
})
export class YourAppComponent {
  constructor(hsConfig: HsConfig) {
    this.HsConfig.update({
      panelsEnabled: {
        measure: true //(false by default)
      }
    });
  }
}

If not using HslayersModule containing all components

Add HsMeasureModule import:

import {HsMeasureModule} from 'hslayers-ng';
@NgModule({
  imports: [HsMeasureModule],
})
export class YourAppModule {}

Add HsMeasureComponent component:

import {HsLayoutService, HsMeasureComponent} from 'hslayers-ng';
@Component({
  selector: 'your-app-component',
  templateUrl: 'your-app-component.html',
})
export class YourAppComponent {
  constructor(hsLayoutService: HsLayoutService) {
    hsLayoutService.createPanel(HsMeasureComponent, {});
  }
}
Clone this wiki locally