Select to view content in your preferred language

Can you evaluate Arcade expressions in MapImageLayer popups?

726
1
Jump to solution
06-27-2018 10:48 AM
NathanielRindlaub
Occasional Contributor

Hi all - 

I'm having trouble getting a popup for a MapImageLayer sublayer to evaluate an arcade expression I set in the expressionInfos property of the popup template. It works fine if I load the layer as a FeatureLayer, but it does not seem to work if I load it as a MapImage Layer. Does that popupTemplate feature simply not work for MapImageLayers?

My popupTemplate is below: 

popupTemplate: {
   title: 'Other Tracts',
   content:
      '<ul><li><strong>Tract Name:</strong> {TRACTNAME}</li>' +
      '<li class=\'{expression/check-othername}\'><strong>Other Name:</strong> {OTHERNAME}</li>' +
      '<li><strong>Conservation Priority:</strong> {TIER}</li>' +
      '<li><strong>Site Name:</strong> {SITENAME}</li>' +
      '<li><strong>Plan Name:</strong> {PLANNAME}</li>' +
      '<li><strong>Plan URL:</strong> {PLANURL}</li>' +
      '<li><strong>Comments:</strong> {COMMENTS}</li>',
   fieldInfos: [{
      fieldName: 'PROTDATE',
      format: {
         dateFormat: 'short-date'
      }
   }],
   expressionInfos: [{
      name: 'check-othername',
      expression: "if($feature.OTHERNAME == NULL){return 'invisible'}"
   }]
}

0 Kudos
1 Solution

Accepted Solutions
NathanielRindlaub
Occasional Contributor

FYI - I reached out to Esri support and they confirmed that arcade expressions are not supported on MapImageLayer sublayers. More info here: Sublayer | API Reference | ArcGIS API for JavaScript 4.7 

View solution in original post

1 Reply
NathanielRindlaub
Occasional Contributor

FYI - I reached out to Esri support and they confirmed that arcade expressions are not supported on MapImageLayer sublayers. More info here: Sublayer | API Reference | ArcGIS API for JavaScript 4.7