layerState is undefined in inView function
Describe the bug A clear and concise description of what the bug is.
In this file: src/ol/layer/Layer.js
It can be that layerState is undefined in the inView function.
This causes an error at this line
export function inView(layerState, viewState) { if (!layerState.visible) { <---------- here is the line causing the error because layerState can be undefined which throws an error
To Reproduce Steps to reproduce the behavior:
- Go to https://maps.nhvr.gov.au/?networkLayerContext=NATIONAL_MAP&view=Category
- Click on select a network and select some segments and open the console.
- See error
Expected behavior A clear and concise description of what you expected to happen.
Will error out because layerState is potentially undefined. Extremely simple to fix, just change it to:
src/ol/layer/Layer.js export function inView(layerState, viewState) { if (!layerState || !layerState.visible) {
This works without causing any unwanted side effects.