Get Current Map View Extent

814
4
11-28-2022 04:08 AM
DougC
by
New Contributor III

Is there a way to get the extents (minx,miny,maxx,maxy) of the current map view using Arcade Script? This is both in Field Maps and a WebApp as I want to use those in an additional process. I can see I can get extent  of features but what about the current view the user has?

Thanks

4 Replies
AnneFitz
Esri Regular Contributor

Hi Doug,

Currently, you can only get the scale of the current map view using $view.scale in the Arcade Visualization profile. 

Could you provide us a little more information about why you want to access the view extent, and how it would be used in your Arcade expression? This will help us consider whether we should support this for a future release.

0 Kudos
DougC
by
New Contributor III

Hi thanks for the reply

I have several REST API endpoints that use extents to perform further querying in external systems. Just having the scale is not really enough for those processed.  Definitely need to know exactly what the user has on their screen in the map window.

Thanks

0 Kudos
DougC
by
New Contributor III

Hi - just to further add to this one - I think if I could access this as $view.extent and it returns Polygon geometry that would be great.

I could then get the extents of that polygon (xmin, ymin, xmax,ymax) to do with whatever I want.

Thanks

0 Kudos
DougC
by
New Contributor III

Would like to poke this one again 🙂
I have an external process that needs the current extent of what the user is looking at. It takes the layers of interest and only performs processing on those layers, in that extent. This is to export a DWG file. So this would be in the Web Map where I can build my REST API request.

Would be good to have...

0 Kudos