Show / Hide Table of Contents

Method ScreenToLocationAsync

ScreenToLocationAsync(Point)

Asynchronously converts a screen coordinate relative to the upper-left corner of the scene view to a location in map coordinates.

Declaration
public async Task<MapPoint> ScreenToLocationAsync(Point screenPoint)
Parameters
Type Name Description
Point screenPoint

The screen coordinate, in pixels.

Returns
Type Description
Task<MapPoint>

A MapPoint on the base surface of the Scene, if this view is initialized and has a loaded scene; otherwise null. This may also return null if the given screenPoint is not on the base surface at all (for example, if the sky is drawn at those coordinates).

Remarks

This is a high performance calculation 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.

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

This method checks for intersection between the input screen point and visible 3D features on the Scene. It returns a point with X, Y and Z values matching the intersection point. If the input point does not intersect a visible 3D feature, the Scene Surface is used to retrieve the point values. If the input point does not intersect the Scene Surface or any visible 3D features a null value is returned.

This method differs from ScreenToBaseSurface(Point) in that the latter only uses the Scene Surface and ignores visible 3D features. The algorithm is inherently slower than ScreenToBaseSurface and is therefore an async operation.

See Also
ScreenToBaseSurface(Point)
LocationToScreen(MapPoint)
LocationToScreen(MapPoint, out LocationVisibility)

Applies to

Platforms and versions
TargetVersions
.NET 6.0 Windows100.13 - 200.2
.NET Framework100.0 - 200.2
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
In This Article
Back to top Copyright © 2022 Esri.