Skip to content

Language panel

Dailis edited this page Oct 7, 2021 · 5 revisions

Language selection

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: {
        language: true //(true by default)
      }
    });
  }
}

If not using HslayersModule containing all components

Add HsLanguageModule import:

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

Add HsLanguageComponent component:

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