laptop and a wrench

Bug

Unable to access a feature’s attributes in a PopupTemplate while using a function to set content for MapImageLayer.

Last Published: November 30, 2018 ArcGIS API for JavaScript
Bug ID Number BUG-000115609
SubmittedJuly 24, 2018
Last ModifiedJune 5, 2024
Applies toArcGIS API for JavaScript
Version found4.7
Operating SystemWindows OS
Operating System Version10.0
StatusNon-Reproducible

Additional Information

Please use the PopupTemplate.outFields property as described in https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#outFields to fix this.

Workaround

  1. Use FeatureLayer class and add them to the map instead of MapImageLayer. This works in versions 4.6 to 4.8
  2. Open the sample application at - https://jsbin.com/qazoxisefo/edit?html,output
  3. The popup returns the population in year 2000 correctly.
  4. Change the API version to 4.7 and then to 4.8 and run again.                                                 
  5. The sample works correctly in the 4.7 and 4.8 version as well. 

Checking the feature.graphic.attributes shows all the attributes. This can be verified by putting a breakpoint in debugger mode at line number 55,  and checking the value of the feature object.

Steps to Reproduce

Bug ID: BUG-000115609

Software:

  • ArcGIS API for JavaScript

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options