The wfslayer class is marked as beta since it has been added in 3.14. Is this ever gonna change? 4.x API doesn't have a WFSLayer... yet?
More bugs in the 3.24 version of WFSLayer:
- The "loaded" property is immediately true after using layer.fromJson(opts). We all know that this can't be correct.
- No "load" event is fired, although the API documentation claims that an "onLoad" event is supported. That particular sentence comes with a broken link to a non-existing anchor. Someone must have copied that over from the GraphicsLayer documentation.
=> No way to tell if the layer was successfully loaded before drawing. - Creating a new WFSLayer doesn't work with options parameter (new WFSLayer(opts)) => no network activity. Only when using an empty constructor call and layer.fromJson(opts) afterwards, requests are fired out to the service (GetCapabilities and a call to the sublayer that is defined in the opts).
I've enhanced the WFSLayer sample with the following code, that shows all of the above mentioned problems:
var opts = {
"url": "https://data.wien.gv.at/daten/geo",
"version": "2.0.0",
"name": "BEZIRKSGRENZEOGD",
"wkid": 4326,
"maxFeatures": 1000
};
var layer = new WFSLayer(opts);
//layer.fromJson(opts);
console.log("layer", layer.loaded, layer);
layer.on("load", function(e) {
console.log("layer loaded", e);
})
var opts1 = {
"url": "https://data.wien.gv.at/daten/geo",
"version": "2.0.0",
"name": "BOTSCHAFTOGD",
"wkid": 4326,
"maxFeatures": 1000
};
var layer1 = new WFSLayer(opts1);
//layer1.fromJson(opts1);
console.log("layer1", layer1.loaded, layer1);
layer1.on("load", function(e) {
console.log("layer1 loaded", e);
})
map.addLayer(layer1);
map.addLayer(layer);
Lloyd Heberlie Bjorn Svensson Julie Powell Any news about the WFSLayer in 3.x and 4.x?