Skip to content

Draw toolbar

Dailis edited this page Oct 12, 2021 · 6 revisions

Draw toolbar

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({
      componentsEnabled: {
        toolbar: true, //(true by default)
        guiOverlay: true, //(true by default)
        drawToolbar: true, //(true by default)
      }
    });
  }
}

If not using HslayersModule containing all components

Add HsDrawModule import:

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

Add HsDrawToolbarComponent component:

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