ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / SpatialReference Property
Example

In This Topic
    SpatialReference Property (Map)
    In This Topic
    Gets the spatial reference of the map.
    Syntax
    Public ReadOnly Property SpatialReference As SpatialReference
    public SpatialReference SpatialReference {get;}
    Example
    Zoom To a Point
    {
      // Note: Needs QueuedTask to run
      {
        //Create a point
        var pt = MapPointBuilderEx.CreateMapPoint(x, y, spatialReference);
        //Buffer it - for purpose of zoom
        var poly = GeometryEngine.Instance.Buffer(pt, buffer_size);
    
        //do we need to project the buffer polygon?
        if (!MapView.Active.Map.SpatialReference.IsEqual(poly.SpatialReference))
        {
          //project the polygon
          poly = GeometryEngine.Instance.Project(poly, MapView.Active.Map.SpatialReference);
        }
    
        //Zoom - add in a delay for animation effect
        mapView.ZoomTo(poly, new TimeSpan(0, 0, 0, 3));
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also