I want to display a hyperlink on the bottom of the popup template in arcgis esri map. I’ve added the code I’ve tried, but hyperlink is not displaying in the popup template. Only the fields table is displaying. Could you please have look into this code and let me know if I’ve missed something.
.ts file
const popUpTemplate = new PopupTemplate({
title: "{name}",
content: [
{
type: "fields",
fieldInfos: [
{
fieldName: "PhysicianName",
label: "Physician Name"
},
{
fieldName: "PrimarySpecialty",
label: "Primary Specialty",
},
]
},
new CustomContent({
outFields: ["*"],
creator: (graphic) => {
const a = document.createElement("a");
a.href = graphic.attributes.url;
a.target = "_blank";
a.innerText = graphic.attributes.url;
return a;
}
})
],
outFields: ["*"]
});
const dataFeedLayer = new FeatureLayer({
source: locationData.map((d,i)=>(
{
geometry: new Point({
longitude: d.longitude,
latitude: d.latitude
}),
attributes: {
ObjectID: i,
...d
}
}
)),
objectIdField: 'ObjectID',
popupTemplate : popUpTemplate,
});
.html file
<!-- Map Div -->
<div #mapViewNode></div>