igo2-lib icon indicating copy to clipboard operation
igo2-lib copied to clipboard

Geo/LayerLegendComponent - Cannot read properties of undefined (reading 'options')

Open alecarn opened this issue 1 year ago • 2 comments
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;

alecarn avatar Jan 12 '24 15:01 alecarn

Sentry issue: IGO2-FRONTEND-2W

sentry[bot] avatar Jan 15 '24 13:01 sentry[bot]

@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;

aziz-access avatar Jan 18 '24 14:01 aziz-access