Here is my code in which I am setting and calling a popup in arcgis-js-api (4.xx) via one rest call... the problem I have an external variable I would like to populate within the field 'place' this external variable doesn't come from the same rest call, I have the value, not sure why it won't accept it in the field?
var place = 'something cool x';
........
var popuptemp = {
title: "Shake Intensity",
content: [{
type: "fields",
fieldInfos: [{
fieldName: "grid_value",
label: "Grid Value"
},
{
fieldName: "id",
label: "id"
},
{
fieldName: "place",
label: "place"
},
{
fieldName: "ObjectID",
label: "ObjectID"
},
{
fieldName: "url",
label: "Url"
}
]
}]
}
fl = new FeatureLayer({
source: gras,
objectIdField: "ObjectID",
geometryType: "polygon",
fields: [{
name: "ObjectID",
alias: "ObjectID",
type: "oid"
}, {
name: "id",
alias: "id",
type: "string"
}, {
name: place <--------------------- tried just calling the var here with no avail, no errors, just nothing displays
alias: "place",
type: "string"
}, {
name: "url",
alias: "url",
type: "string"
}, {
name: "grid_value",
alias: "grid_value",
type: "double"
}],
renderer: renderer,
popupEnabled: true,
popupTemplate: popuptemp
});
map.add(fl);