screenToLocation

suspend fun screenToLocation(screenCoordinate: ScreenCoordinate): Result<Point>

Converts a screen coordinate to a location in scene coordinates, considering both the scene's base surface and other scene content.

Note that elevation values are approximated, and as the distance between the camera and the surface increases, the precision of the elevation value decreases.

This method will fail with an error when:

  • The provided screen coordinates are outside of the bounds of the current screen

  • The view does not have a spatial reference

  • The screen coordinates contain NAN values

If the provided screen coordinates do not intersect with the surface of the local scene, the returned point will be empty.

To call this method, assign a local scene to the local scene view and ensure that it is loaded.

Return

a Result containing a point on the scene.

Since

300.0.0

Parameters

screenCoordinate

The screen coordinate. The coordinate of the top left corner of the screen is 0,0.