Skip to content

Add data panel

Raitis Berzins edited this page Oct 6, 2021 · 16 revisions

Catalogue

Layer by URL

Layer by file upload

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

If not using HslayersModule containing all components

Add HsAddDataModule import:

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

Add HsAddDataComponent component:

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