Parameters
- pagePoint
- The point in page coordinates
Return Value
A point in map coordinates
Exception | Description |
---|---|
System.InvalidOperationException | Mapframe must contain a 2D map |
System.ArgumentNullException | pagePoint |
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
//On the QueuedTask var layout = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault().GetLayout(); var mapFrame = layout.FindElement("New Map Frame") as MapFrame; //Get a point in the center of the Map frame var mapFrameCenterPoint = mapFrame.GetBounds().CenterCoordinate; //Convert to MapPoint //At 2.x - var pointInMapFrame = MapPointBuilder.CreateMapPoint(mapFrameCenterPoint); var pointInMapFrame = MapPointBuilderEx.CreateMapPoint(mapFrameCenterPoint); //Find the corresponding point in the MapView var pointOnMap = mapFrame.PageToMap(pointInMapFrame); //Create a point graphic on the MapView. var cimGraphicElement = new CIMPointGraphic { Location = pointOnMap, Symbol = pointSymbol.MakeSymbolReference() }; graphicsLayer.AddElement(cimGraphicElement);
Target Platforms: Windows 11, Windows 10