igo2-lib
igo2-lib copied to clipboard
Geo/LayerLegendComponent - Cannot read properties of undefined (reading 'options')
trafficstars
Cannot read properties of undefined (reading 'options')
In LayerLegendComponent :
ngOnInit() {
let lastlLegend = this.layer.legend;
this.styles = this.listStyles();
const sourceOptions = this.layer.options.source.options as any;
if (sourceOptions && sourceOptions.params && sourceOptions.params.STYLES) {
// if a styles is provided into the layers wms params
this.currentStyle = this.styles.find(
(style) => style.name === sourceOptions.params.STYLES
).name;
Sentry issue: IGO2-FRONTEND-2W
@alecarn i can't handle the error exactly we need mor information..., but i think here we have a bad layer configurations. i can make check for the value of the property 'options' to solve this.
const sourceOptions = this.layer.options.source.options as any;