AnsweredAssumed Answered

javascript in ArcGIS Online

Question asked by amber_cline on Dec 27, 2017
Latest reply on Dec 29, 2017 by KGerrow-esristaff

I'm attempting to use javascript in ArcGIS Online's popup in the mapviewer and am having some issues with getting a function to stick with it.


I have added a LiveFeed layer, NOAA_METAR_current_wind_speed_direction from the MapServer. However, the Wind Speed is displayed in km/h and I would like convert it to mph.


However, I've been unsuccessful in getting a function for converting the data to work. What ultimately happens is that when I 'ok' the script in the Custom Attribute Display, nothing will happen, and when I reopen to check the script - it has disappeared. 

I've attempted to enter a simple divide function, tried closing the function in <script> </script>, etc and it all disappears when I reopen the Custom Attribute Display. I'm almost thinking that AGOL doesn't allow you to apply conversions to the data.

If anyone has advice on how to convert km/h to mph successfully, it would be greatly appreciated. 


If further clarification is needed, please let me know. 


Thank you