Method ScreenToLocationAsync
ScreenToLocationAsync(Point, CancellationToken)
Asynchronously converts a screen coordinate, relative to the upper-left corner of the LocalSceneView, to a location in scene coordinates.
Declaration
public Task<MapPoint?> ScreenToLocationAsync(Point screenPoint, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | screenPoint | The screen coordinate. The coordinate of the top left corner of the screen is 0,0. |
| CancellationToken | cancellationToken | A cancellation token that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task<MapPoint> | A point on the scene. |
Remarks
This calculation is executed on the GPU using a triangular mesh. Note that elevation values are approximated, and as the distance between the camera and the surface increases, the precision of the elevation value decreases.
If the provided screen coordinates are outside of the bounds of the current screen, this method will immediately fail with an error.
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 LocalSceneView and ensure that it is loaded.
See Also
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET | 300 |
| .NET Windows | 300 |
| .NET Android | 300 |
| .NET iOS | 300 |