Hi all,
I am seeing an interesting issue when trying to use a WFSLayer. This is not returning the name field in the response. Is this a reserved word or am I missing something else?
An example call to our endpoint: https://ugs-geoserver-prod-flbcoqv7oa-uc.a.run.app/geoserver/groundwater/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=groundwater%3Augs_gw_sites&maxFeatures=2&outputFormat=application%2Fjson
See below for a code sample:
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>WFSLayer | Sample | ArcGIS Maps SDK for JavaScript 4.30</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.30/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.30/"></script>
<script type="module" src="https://js.arcgis.com/calcite-components/2.8.5/calcite.esm.js"></script>
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/calcite-components/2.8.5/calcite.css" />
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/WFSLayer",
"esri/layers/ogc/wfsUtils",
"esri/widgets/LayerList"
], function (Map, MapView, WFSLayer, wfsUtils, LayerList) {
let wfsCapabilities;
// set up map and view
const map = new Map({
basemap: "gray-vector"
});
const view = new MapView({
container: "viewDiv",
map: map,
center: [-112, 39.5],
zoom: 7,
});
// create and add a WFSLayer to the map
const layer = new WFSLayer({
url: "https://ugs-geoserver-prod-flbcoqv7oa-uc.a.run.app/geoserver/groundwater/ows", // url to your WFS endpoint
name: "groundwater:ugs_gw_sites", // name of the FeatureType
popupTemplate: {
title: "{site_name}",
content: "this should be a name: {name}, projectId: {projectId}, siteId: {siteId}"
}
});
map.add(layer);
view.ui.add(
new LayerList({
view: view
}),
"bottom-left"
);
});
</script>
</head>
<html lang="en">
<body>
<div id="viewDiv"></div>
</body>
</html>