I have recently upgraded to v2.0 of CMV in the hope of using WFS layers. However, when configuring a WFS layer in viewer.js, no layers are loaded on the map (and there are no errors reported in the browser console).

Unfortunately I can't find any documentation around this functionality, and the only example I can find for loading WFS with the ArcGIS API for JavaScript doesn't seem to work.

Steps to reproduce:

Add a WFS layer to the operationalLayers array in viewer.js, for example:

{
            type: 'wfs',
            title: 'Roads',
            options: {
                url: "https://domain.com/arcgis/services/group/layer/MapServer/WFSServer" ,
                name: 'roads',
                version: "2.0.0",
                wkid: 29902
            },
            editorLayerInfos: {
                disableGeometryUpdate: false
            },
            legendLayerInfos: {
                exclude: false,
                layerInfo: {
                    title: 'Roads'
                }
            },
            layerControlLayerInfos: {
                exclude: false,
                noZoom: true
            }
        },

Load the map viewer. Expected results: I would expect to see the WFS layer on the map, as well as being able to switch it on/off it using the layer control widget.

Actual results: The layer isn't added. Other operational layers do load, but the layer control is not visible in the left pane as it should be. Background layers also fail to load. There are no errors in the browser console.

I have also tried tweaking the code in _initLayer() within _MapMixin.js to load the WFS layer differently (as in the example here) but this does not load any features. It does execute a GetCapabilities request like the example, but I am not sure what to do next.

Environment:

Software Version CMV Version 2.0.0-beta2 Browser Chrome Operating system Windows 7

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.