hello,
I have a MapImageLayer (hosted on our portal), with several sublayers. I wish to display some other data in the popup by using a function to return the content (the function is getting called, and I can return what I want). However, the attribute data I need to create/query the other data (non-arcgis data) is not being passed to the content function. The only attribute being sent back is the 'Name' field, and I cannot find a way to set the outFields property for the query that gets run.
Snippet
this.map.layers.forEach((layer) => {
if (layer.title === 'Some Title') {
layer.outFields = ["*"];
layer.sublayers.forEach(subLayer => {
subLayer.outFields = ["*"];
if (subLayer.title === 'hidden layer') {
subLayer.visible = false;
} else if (subLayer.title === 'other layer') {
this.otherLayer = subLayer;
}
subLayer.popupTemplate = {
title: subLayer.title,
content: this.getData.bind(this),
actions: [{
id: subLayer.title,
className: 'esri-icon-table',
title: 'Dashboard'
}]
};
}
});
}
});
Snippet
getData(evt) {
console.debug(evt);
console.debug(this.view.popup.viewModel.selectedFeature);
There are definitely more attributes on the layer, but only Name is being returned. Am I missing something somewhere in my code to set the outFields for a Portal hosted MapImageLayer? or is there something I need to have changed in the service to return all attributes? thanks!