I am upgrading an app from 4.22 to 4.24 and so far it has gone smoothly but this custom content function to populate the popup will not work now. It stops at line 17. What am I missing?
function contentSpecies(feature) {
console.log(feature);
var contentSpecies = "";
objectID = feature.graphic.attributes.OBJECTID;
console.log(objectID);
var queryURL = "https://webmaps.com/Species/MapServer/1";
var speciesSpecs = new RelationshipQuery({
outFields: ["OBJECTID", "Species", "Notes", "Status", "Known_elevation_range", "Habitat_Description", "Link_to_More_Information"],
//returnGeometry: true,
relationshipId: 0,
objectIds: [objectID]
});
//var idArray = [];
console.log(speciesSpecs);
query.executeRelationshipQuery(queryURL, speciesSpecs).then(function (rslts) {
console.log(rslts);
var features = rslts[objectID].features;
features.forEach(function(ftr) {
var t = ftr.attributes;
var species = t.Species;
contentSpecies += "<span class='bold' title='Species'><b><font size='3'><span class='uppercase'>" + species + "</span></font></b></span><br>";
var range = t.Known_elevation_range;
contentSpecies += "<span class='bold' title='Notes'><b>Known Elevation Range: </b></span>" + range + "<br/>";
var habitat = t.Habitat_Description;
contentSpecies += "<span class='bold' title='Status'><b>Habitat: </b></span>" + habitat + "<br/>";
var url = t.Link_to_More_Information;
contentSpecies += "<span class='bold' id='more' title='Status'><b>More Info: </b></span> <a target='_blank' href='" + url + "'>Link</a><br/><br>";
})
.catch((error) => {
console.log("species query error", error)
});
});
console.log("Open")
var thetitle = contentTitle(feature);
mapView.popup.open({
title: "Sensitive Amphibian Species " + thetitle,
content: contentSpecies,
outFields: ["*"],
visibleElements: {featureNaviagtion: true, closeButton: true}
})
}