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
SamF2016source.addFeatures(features);
}).catch(function (error) {
console.log(error.message);
})
}
});
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">
<Name>1</Name>
<Title>
<![CDATA[ SamF2013 ]]>
</Title>
<Abstract>
<![CDATA[ ]]>
</Abstract>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:28992</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>4.211658</westBoundLongitude>
<eastBoundLongitude>6.025627</eastBoundLongitude>
<southBoundLatitude>51.244639</southBoundLatitude>
<northBoundLatitude>51.815840</northBoundLatitude>
</EX_GeographicBoundingBox>
<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"/>
<Style>
<Name>default</Name>
<Title>1</Title>
<LegendURL width="130" height="928">
<Format>image/png</Format>
<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"/>
</LegendURL>
</Style>
</Layer>
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?