1

With OpenLayers 4, I'm trying to get field names from a WFS request (https://localhost:8080/myws?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=2.0.0&TYPENAME=ms:layername&outputFormat=gml/2.1.2) and parse it into JSON or something else.

I found a solution, but it is for OpenLayers 2 (example)

Does somebody know if

OpenLayers.Format.WFSDescribeFeatureType();

will be deployed into OpenLayers 4?

Any other way possible? My goal is to "harvest" my WFS DescribeFeatureType to populate a filtering menu.

  • I have a feeling that OpenLayers 3 (and presumably 4) doesn't support WFS version 2.n so it's not just a supported operation issue. – nmtoken Aug 7 '17 at 19:57
  • Your are right. But my call could also be in version 1.0.0 – PEL Aug 7 '17 at 19:59
1

Look at jsonix [1] and w3c-schemas [2] instead

import {XSD_1_0} from 'w3c-schemas/lib/XSD_1_0';
const xsdContext = new Jsonix.Context([XSD_1_0]);
const xsdUnmarshaller = xsdContext.createUnmarshaller();
var schema = xsdUnmarshaller.unmarshalString(xmlhttp.responseText).value;
var element = schema.complexType[0].complexContent.extension.sequence.element;

[1] https://github.com/highsource/jsonix [2] https://github.com/highsource/w3c-schemas

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.