ODIN icon indicating copy to clipboard operation
ODIN copied to clipboard

Error selecting a WMS layer

Open ThomasHalwax opened this issue 3 years ago • 1 comments

When trying to add a WMS layer from https://data.wien.gv.at/daten/wms?service=WMS&request=GetCapabilities&version=1.1.1 ODIN dies with the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'filter')
    at Object.crs (wms.js:13)
    at handleLayerSelected (WMXOptions.js:94)
    at onClick (WMXLayerTable.js:30)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
    at invokeGuardedCallback (react-dom.development.js:4056)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4070)
    at executeDispatch (react-dom.development.js:8243)
    at processDispatchQueueItemsInOrder (react-dom.development.js:8275)
    at processDispatchQueue (react-dom.development.js:8288)

ThomasHalwax avatar Feb 09 '22 10:02 ThomasHalwax

Might be caused by schema differences between WMS versions 1.1.1 and 1.3.0. There is a comment on ol/TileWMS (params option) which suggests this:

WMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically.

https://openlayers.org/en/latest/apidoc/module-ol_source_TileWMS-TileWMS.html

dehmer avatar Feb 09 '22 18:02 dehmer