Skip to content

Feature table panel

Dailis edited this page Oct 20, 2021 · 11 revisions

Feature table

This component lists all available layer features from layers added inside HsConfig.layersInFeatureTable array. It allows to sort the features based on their attributes, stats and filter them based on their name property.

/img/feature-table.png

Set feature table layers

this.HsConfig.update({
      layersInFeatureTable: [vectorlayer],
});

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

If not using HslayersModule containing all components

Add HsFeatureTableModule import:

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

Add HsFeatureTableComponent component:

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