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 Task<MapPoint> ScreenToLocationAsync(Point screenPoint)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.Point | screenPoint | The screen coordinate, in device-independent pixels (DIPs). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MapPoint> | A MapPoint on the base surface of the Scene, if this view is initialized
and has a loaded scene; otherwise |
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
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET | 200.0 - 200.6 |
.NET Windows | 200.0 - 200.6 |
.NET Android | 200.3 - 200.6 |
.NET iOS | 200.0 - 200.6 |