-
Notifications
You must be signed in to change notification settings - Fork 20
Legend panel
Filip Leitner edited this page Apr 30, 2024
·
6 revisions
Legend panel gathers legends from all layers added to map and displays them in a list. They can be ImageWms, TileWms services for which legend is served by the WMS provider (geoserver, mapserver etc.) or Vector layers for which legend is derived from Openlayers style or SLD string. For that geostyler-legend library is used under the hood.
import {HsConfig} from 'hslayers-ng/config';
@Component({
selector: 'your-app-component',
templateUrl: 'your-app-component.html',
})
export class YourAppComponent {
constructor(hsConfig: HsConfig) {
this.HsConfig.update({
panelsEnabled: {
legend: true //(true by default)
}
});
}
}
Add HsLegendModule import:
import {HsLegendModule} from 'hslayers-ng/components/legend';
@NgModule({
imports: [HsLegendModule],
})
export class YourAppModule {}
Add HsLegendPanel component:
import {HsLayoutService } from 'hslayers-ng/core';
import {HsLegendModule} from 'hslayers-ng/components/legend';
@Component({
selector: 'your-app-component',
templateUrl: 'your-app-component.html',
})
export class YourAppComponent {
constructor(hsLayoutService: HsLayoutService) {
hsLayoutService.createPanel(HsLegendComponent, {});
}
}
Quick Links: Home ➖ App configuration ➖ Layer configuration ➖ Cesium configuration ➖ Composition schema (separate repo)