Skip to content

WFS layer fails to load when server uses no namespace prefix #93

Description

@Vrouwenpolder

Description

When configuring a wfsDatasets entry with an empty featureTypeNamespace (required for WFS servers, such as QGIS Server, that publish feature types without a namespace prefix), the WFS layer fails to load with:

Uncaught TypeError: Cannot read properties of undefined (reading 'getElementsByTagNameNS')
at n.parse (leaflet-wfst.src_custom.js:2:11553)
at n.setFeatureDescription (leaflet-wfst.src_custom.js:2:12745)

Root cause

leaflet-wfst.src_custom.js unconditionally builds the WFS typeName request parameter as:

var typeName = featureTypeNamespace + ':' + featureTypeName;

Even when featureTypeNamespace is an empty string, this still produces a malformed typeName with a stray leading colon (e.g. :layername instead of layername).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions