Select to view content in your preferred language

Arcade geometry and projections in AGOL/Pro

292
0
08-11-2022 04:42 AM
Labels (1)
DebHSF
by
Regular Contributor

I've noticed a difference between how Arcade behaves between ArcGIS Pro pop-ups and AGOL web map pop-ups, and wondering if anyone knows the reason/how to get around it?

Our aim is to fill in a custom expression field with a British National Grid Reference, using the geometry function in Arcade, i.e.:

var Arcadex = round(Geometry($feature).x, 0)
var Arcadey = round(Geometry($feature).y, 0)

return Arcadex + " " + Arcadey

The hosted feature layer is in BNG format (spatial ref 27700). 

In ArcGIS Pro, the above expression brings back the correct number no matter what the basemap project is - whether it is a BNG basemap or a WGS1984 basemap.

In ArcGIS Online, the expression only works if the basemap is a BNG basemap. If it's one of Esri's standard WGS1984 basemaps, the expression brings up a different number.

Ideally we want users to be able to switch between different basemaps (in particular the Esri imagery one is useful) and the expression still work. Any suggestions welcome!

0 Replies