How to calculate SceneView's Extent

163
1
2 weeks ago
michaelkdev
New Contributor III

Hi all.

I want to calculate the extent / visible area (xmin, ymin, xmax, ymax) in a scene view / sphere / web mercator projection wkid 102100 with the ArcGis Javascript API. Given camera position of latitude 51 and longitude 4, z position of 4000m (meters). Given a tilt of 40, a heading of 300 and a field of view of 55. How to calculate the extent in 3D view based on these parameters?
 
When switching from 2D to 3D. I get 

michaelkdev_0-1714632896129.png

 

We use the extent to fetch data from an API. (So we're expecting a correct extent in 3D). Maybe we can use a library or something?

Can someone help me?

Thanks!

 

Gr

Michael

 
 
 
 
0 Kudos
1 Reply
ArnoFiva
Esri Contributor

Because of rotation and tilt, an extent can never correctly cover the camera's visible area in 3D. We currently offer two possibilities

  • SceneView.extent: I assume you are already using that.
  • GroundView.extent: similar to the above, but specifically tailored to the ground elevation, making it more precise for some situations.

It might help to know that we are currently working on a property with the visual area. Because this will be provided as a polygon, it will take tilt and rotation into account. This is planned to land this year, potentially in the upcoming 4.30 release.

In the meantime you could increase the size of the extent returned by SceneView using Extent.expand. Computing the extent or visible area yourself is rather complex and I cannot point you to any recourses. Our own implementation takes various factors into account, such as the elevation or visible geometries in the view.

0 Kudos