ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Core.UnitFormats Namespace / DisplayUnitFormat Class / FormatLocation Method / FormatLocation(Double,Double,SpatialReference) Method
The x coordinate
The y coordinate
The spatial reference. WGS84 is assumed if sr is null

In This Topic
    FormatLocation(Double,Double,SpatialReference) Method
    In This Topic
    Format the input location using the location unit format. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public string FormatLocation( 
       double x,
       double y,
       SpatialReference sr
    )
    Public Overloads Function FormatLocation( _
       ByVal x As Double, _
       ByVal y As Double, _
       Optional ByVal sr As SpatialReference _
    ) As String

    Parameters

    x
    The x coordinate
    y
    The y coordinate
    sr
    The spatial reference. WGS84 is assumed if sr is null

    Return Value

    A formatted location string
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run
    Remarks
    The UnitFormatType must be of type UnitFormatType.Location or an empty string will be returned.
    If either of x or y is double.NaN an empty string will be returned.
    If the spatial reference is null then WGS84 is assumed.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also