I've the following JS code which should present 2 WFS layers on map on the screen:
map = new Map("map", { basemap: "gray", center: [16.4, 48.2], zoom: 11, }); esriConfig.defaults.io.proxyUrl = "/proxy/"; var url = "https://data.wien.gv.at/daten/geo"; var layer1 = new WFSLayer(); layer1.fromJson({ "url": url, "name": "BEHINDERTENPARKPLATZOGD" }); var layer2 = new WFSLayer(); layer2.fromJson({ "url": url, "name": "BEZIRKSGRENZEOGD" }); map.addLayers([layer1, layer2]);
Unfortunatelly, when I run this code in the browser - only first layer is presented on the map screen (in my case -it is: layer1). When I change the order of added layers (for example: map.addLayers([layer2, layer1])) - still only first layer is visible on the map screen ("layer2" in this case)
ArcGis JavaScript API version we're currently using is: 3.23
Any ideas?
Same in 3.24
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:
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?
Søren Boll Overgaard I agree that doesn't sounds right. We're researching possible next steps, it may take a day or so since folks are on vacation.
Niklas Köhn, you'll need to go thru Redlands tech support to have those bugs fully triaged and tracked. I sent you a separate email with additional details.
Thanks Andy, I'll do that.
Søren Boll Overgaard looks like we only plan to support one layer in 3.x WFSLayer. Is there any chance you can convert that data to a different type of layer? There's a good chance that would offer more capabilities and better performance.
I am also trying to add more than one WFSLayer layer in 3.x and facing the same issue
Could someone please confirm currently also, it is not supported to add more WFS layer using 3.x Escri Map ?
Note : But in arcgis online I was able to achieve it, isn't same technology used in Arcgis online ?