Hi all, I have be messing around with the ArcGIS API for Javascript. So far, I have a basemap, added in a point feature layer that I published to AGOL and I have set up a popup template displaying the attributes from my feature layer.
I would like to display live data in my popup when a user clicks on a point feature.
How would I go about using the ID from the point feature selected, embed that into a URL and then run a HTTP GET request (with Header auth) and return the data . Then take that data and use it in my popup.
I am hoping to find some sample code where the popup attribute data is being pulled from a URL or feature layer that is not currenlly added to the map.
My HTTP GET request returns the data like below:
<max_speed>59</max_speed>
<avg_speed>40</avg_speed>
<avg_speed85>49</avg_speed85>
<speed_limit>40</speed_limit>
<speed_type>kmh</speed_type>
<recorddatetime="2017-06-27 15:00:00">…</record>
Any assistance would be appreciated.
Thanks