Select to view content in your preferred language

ArcGIS 4.14 popup field attributes not showing

02-17-2020 01:44 AM
New Contributor


I am using webamp to show the map created in ArcGIS (Javascript API in PHP website). In the map, a popup also appears when clicking on the layer's points. Recently I have updated the version 4.14 from 4.13. After updating it, the popup is not working properly. I have a custom popup template. After research in the documentation, I came to know there required a return function to show the custom div on the popup. The below code I have added to show my custom popups.

var template = { content: function(){ var div = document.createElement("div"); div.className = "myClass"; div.innerHTML = "<span>My custom content!</span>"; return div; } }

layers[layerIndex].popupTemplate = template;

Now the popup appears fine. But I have to show the field values on the popup. I have used the required field attributes in double brackets eg: {Name}. But in the latest version, the field values are not appearing when I used the same. 

The code I have used in version 4.13 and it was working,

popupTemplate = {
title: "{Name}",
content: '<div id="popup_address">{Address}</div><div class="right"><div href="#" id="popupRight" class="toggle"><p onClick="openPopupDetails({FACILITYID})">+</p></div></div>' };

layers[layerIndex].popupTemplate = popupTemplate;

Please help me to fix this issue.


0 Kudos
1 Reply
by Anonymous User
Not applicable

Hi Adarsh Sukumaran‌ - not sure if you have found an answer to this yet, but wanted to cross-post this to the ArcGIS API for JavaScript‌ space to see if folks there may have seen this before. 

Let me know, and I can also assist with getting a case open with a ArcGIS API for Javascript analyst in Esri Support.



0 Kudos