When I load my WFS into OpenLayers 4 it does not use the custom style which I've specified in ArcGIS Server. The points appear in the default OL style (white transparent fill with a blue outline).

I remember that when I used GeoServer the styles specified in the server would automatically appear in OL. So I expected it to be the same way with ArcGIS Server, but I guess that is not the case. I've added styles=default& in the WFS URL but with no success.

The JS I'm using to load the WFS:

SamF2016source = new ol.source.Vector({
format: new ol.format.WFS(),
loader: function (extent, resolution, projection) {
    var url = 'https://atlas.brabant.nl/arcgis/services/fauna/MapServer/WFSServer?request=GetFeature&typeName=SamF2016&version=1.1.0&styles=default&SRSname=EPSG:3857&outputFormat=gml3';
    // Use fetch, more simple & modern instead of XMLHttpRequest
    fetch(url).then(function (response) {
        return response.text();
    }).then(function (text) {
        var features = SamF2016source.getFormat().readFeatures(text);
        // Add parsed features to vectorSource
    }).catch(function (error) {

SamF2016 = new ol.layer.Vector({
    source: SamF2016source,
    setZIndex: 1005,
    title: 'SamF2016',
    visible: false,

In the GetCapabilities of the server the style is specified as so (bottom part of the GML):

Layer queryable="1">
<![CDATA[ SamF2013 ]]>
<![CDATA[ ]]>
<BoundingBox CRS="CRS:84" minx="4.211658" miny="51.244639" maxx="6.025627" maxy="51.815840"/>
<BoundingBox CRS="EPSG:4326" minx="51.244639" miny="4.211658" maxx="51.815840" maxy="6.025627"/>
<BoundingBox CRS="EPSG:28992" minx="73913.494800" miny="362246.413600" maxx="198987.600000" maxy="425141.200000"/>
<LegendURL width="130" height="928">
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://atlas.brabant.nl/arcgis/services/fauna/MapServer/WmsServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=1" xlink:type="simple"/>

When GetLegendGraphic is called the right symbology returns: http://atlas.brabant.nl/arcgis/services/fauna/MapServer/WmsServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=1

With a GetMap request the right symbology also returns (BBOX is a bit off but you get the idea): https://atlas.brabant.nl/arcgis/services/fauna/MapServer/WMSServer?request=GetMap&service=WMS&version=1.1.0&layers=1&styles=default&srs=EPSG:28992&bbox=-73913.494800,362246.413600,198987.600000,425141.200000&&width=780&height=330&format=image%2Fpng

What code do I need to add/adjust so that the points in my OL map appear like the symbology in the GetLegendGraphic and GetMap requests?

1 Answer 1


WFS don't give any rendered style, it's for you to apply. This is what any WFS does ~ gives you vector data.

WMS give an image where you give a style (using SLD) or you accept the default style.

The GetCapabilities you give is showing you the capabilities of the WMS, the WFS has a different GetCapabilities response, and different capabilities.

For the FeatureType that you are requesting has the following capabilities, there are no styles here:

        <Format>application/gml+xml; version=3.2</Format>
        <ows:LowerCorner>4.2697569340901396 51.221271739696967</ows:LowerCorner>
        <ows:UpperCorner>6.029130352568183 51.822105829878616</ows:UpperCorner>

Note the responses of the GetCapabilities requests is not GML its text/xml

  • That makes sense, thanks. So if I understand correctly it is not that easy to create a custom style like mine for a WFS? Having various amounts of fieldnames en colors.
    – Lout
    May 23, 2018 at 9:42
  • You can't (AFAIK ~ would depend on the output formats supplied) create a style for a WFS, (you can't have the server apply a style that you request with the data), you can only style the data you receive from a WFS, that is apply the style in your client whether it be OpenLayers or ArcGIS or QGIS. Certainly with this service which only gives GML, you can't add a style. In the future with the support of vector tiles it might be a possibility.
    – nmtoken
    May 23, 2018 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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