AnsweredAssumed Answered

Adding a FeatureLayer with a configured popup

Question asked by kenbuja Champion on Sep 6, 2017
Latest reply on Sep 6, 2017 by kenbuja

In my widget, I'm adding a FeatureLayer that is a hosted feature service on AGOL. It has a popup configured and some of the fields contain domains. I can add the layer to the existing web map, but I can't seem to get the configured popup to show up properly. This is how it's configured in the service.


If I use the syntax

this._layerSPGrid = new FeatureLayer(SPGridUrl, {
  outFields: ['*'],
  id: "Priority",
  infoTemplate: new InfoTemplate()

then the popup doesn't show the field aliases or domain values and gives me some extraneous fields (GlobalID, Shape__Area, Shape__Length)


If I omit the infoTemplate from the constructor, I have to go into the Layer List widget and enable the popup. This popup shows the domains, but not the field aliases and adds Shape__Area and Shape__Length


What's the correct way to add the configured popup? I don't want to configure the infoTemplate in the code. I could live with the second option, but I don't want to require the user to enable the popup.