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'}"
}]
}
Solved! Go to Solution.
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
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