ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping.DeviceLocation Namespace / MapDeviceLocationService Class / ZoomOrPanToCurrentLocation Method
Set to true to zoom.

In This Topic
    ZoomOrPanToCurrentLocation Method (MapDeviceLocationService)
    In This Topic
    Zooms or pans the active map view to the current location, keeping the current device location at the center. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void ZoomOrPanToCurrentLocation( 
       bool zoom
    )
    Public Sub ZoomOrPanToCurrentLocation( _
       ByVal zoom As Boolean _
    ) 

    Parameters

    zoom
    Set to true to zoom.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    The active map view cannot be null
    Remarks
    There must be an active map view with an associated map or a System.InvalidOperationException will be thrown
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also