I'm using esri-loader which loads ArcGIS 4.15 in an angular cli v9 app. I'm experiencing the following behavior with the editor widget:
Essentially the attributes aren't showing up when initially selecting the area. Only 'undefined' for all features & layers. When I drill down to the feature, the attributes appear fine. I noticed a similar behavior with popups, where the popup was displaying attributes as 'undefined', but was able to resolve it there by setting the "outfields" property on the popup. However, there doesn't appear to be a similar property for the editor widget. Thoughts?
Solved! Go to Solution.
So, after looking through the api a little more, I found the "displayField" property. That did the trick.
var trailheadsLayer = new FeatureLayer({
url: "https://services6.arcgis.com/708LZoWlLL5mAZXZ/arcgis/rest/services/trailheads/FeatureServer",
popupTemplate: trailHeadPop,
displayField: "TRL_NAME",
outFields: ["*"]
});
Thanks for your help and apologies for not reading the api a little more thoroughly before posting!
Did you set the outFields property of the FeatureLayer?
Thanks for the quick reply.
I had not set it for the layer, only popups. I just adjusted the code (see below) but unfortunately it didn't seem to help.
var trailheadsLayer = new FeatureLayer({
url: "https://services6.arcgis.com/708LZoWlLL5mAZXZ/arcgis/rest/services/trailheads/FeatureServer",
popupTemplate: trailHeadPop,
outFields: ["*"]
});
So, after looking through the api a little more, I found the "displayField" property. That did the trick.
var trailheadsLayer = new FeatureLayer({
url: "https://services6.arcgis.com/708LZoWlLL5mAZXZ/arcgis/rest/services/trailheads/FeatureServer",
popupTemplate: trailHeadPop,
displayField: "TRL_NAME",
outFields: ["*"]
});
Thanks for your help and apologies for not reading the api a little more thoroughly before posting!