Hi Folks,
I have Location Sharing active with Field Maps and Survey123 app. My users are using a custom webmap I developed to monitor field crew. In a recent followup meeting, they suggested me if the lat/lon position for the last known location can be shown on the popup (see attached). I thought it was a piece of cake to add that info. After looking into the sharing location view, I noticed there's no data for lat/lon positions. All hosted layer contains lat/lon columns, but not the location sharing views. How I can I enable these columns?
Any suggestions on how to show these two really important pieces of data for location?
Thanks!
MJ
Solved! Go to Solution.
The most reliable way it to use Arcade so that it is dynamic. Columns would just be static text or numbers so if someone moves the point later they are off. Arc stores the actual coords in the Shape field.
Assumes map is web Mercator map and want to display WGS84.
CurrentLat
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lat = (Geometry($feature).y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
return lat;
CurrentLong
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (Geometry($feature).x / originShift) * 180.0;
return lon;
hope that helps
The most reliable way it to use Arcade so that it is dynamic. Columns would just be static text or numbers so if someone moves the point later they are off. Arc stores the actual coords in the Shape field.
Assumes map is web Mercator map and want to display WGS84.
CurrentLat
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lat = (Geometry($feature).y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
return lat;
CurrentLong
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (Geometry($feature).x / originShift) * 180.0;
return lon;
hope that helps
Hi @DougBrowning ,
It worked just fine and it did what I needed (see screenshot). I didn't figure out I was able to extract location from the geometry feature.x and feature.y data. Thanks for sharing the code.
MS