public MapPoint ScreenToMap( Point screenPoint )
Public Function ScreenToMap( _ ByVal screenPoint As Point _ ) As MapPoint
Parameters
- screenPoint
- The point value in screen coordinates.
Return Value
The converted point in map coordinates.
public MapPoint ScreenToMap( Point screenPoint )
Public Function ScreenToMap( _ ByVal screenPoint As Point _ ) As MapPoint
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
//Selection tolerance for the map in pixels var selectionTolerance = SelectionEnvironment.SelectionTolerance; QueuedTask.Run(() => { //Get the map center var mapExtent = MapView.Active.Map.GetDefaultExtent(); var mapPoint = mapExtent.Center; //Map center as screen point var screenPoint = MapView.Active.MapToScreen(mapPoint); //Add selection tolerance pixels to get a "radius". var radiusScreenPoint = new System.Windows.Point((screenPoint.X + selectionTolerance), screenPoint.Y); var radiusMapPoint = MapView.Active.ScreenToMap(radiusScreenPoint); //Calculate the selection tolerance distance in map uints. var searchRadius = GeometryEngine.Instance.Distance(mapPoint, radiusMapPoint); });
Target Platforms: Windows 11, Windows 10