HOW TO
In ArcGIS Pro, the coordinates of features can be displayed in pop-ups. While the Calculate Geometry Attributes tool can be used to add the location information to each feature, new fields are created to populate the values in the feature layer. If the coordinates are only used for display purposes and are not required to be stored in the feature layer, use the custom Arcade expression provided in this article to display the features' coordinates in degrees, minutes, and seconds (DMS) in the pop-ups.
function MetersToLatLon(x, y) { var originShift = 2.0 * PI * 6378137.0 / 2.0; var longitude = (x / originShift) * 180.0; var latitude = (y / originShift) * 180.0; latitude = 180.0 / PI * (2.0 * Atan( Exp( latitude * PI / 180.0)) - PI / 2.0); return [latitude, longitude]; } function convertToDms(dd, isLng) { var dir = ""; if (dd < 0) { if (isLng) { dir = "E"; } else { dir = "W"; } } else { if (isLng) { dir = "S"; } else { dir = "N"; } } var absDd = Abs(dd); var deg = Floor(absDd, 0); var frac = absDd - deg; var min = Floor(frac * 60, 0); var sec = frac * 3600 - min * 60; sec = Round(sec * 100) / 100; return deg + "°" + min + "'" + sec + '"' + dir; } var latlon = MetersToLatLon(Geometry($feature).X, Geometry($feature).Y); var latitude = convertToDms(latlon[0], False); var longitude = convertToDms(latlon[1], False); return longitude+" "+latitude;
The coordinates of the point feature are displayed in DMS in the pop-up.
Get help from ArcGIS experts
Download the Esri Support App