Method ScreenToLocationAsync
ScreenToLocationAsync(PointF)
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(PointF screenPoint)
Parameters
Type | Name | Description |
---|---|---|
Android.Graphics.PointF | screenPoint | The screen coordinate, in pixels. The coordinate of the top left corner of the screen is 0,0. |
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(PointF) 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 Android | 200.3 - 200.5 |
Xamarin.Android | 100.0 - 100.14 |