ArcGIS Pro 2.9 API Reference Guide
ZoomOrPanToCurrentLocation Method (MapDeviceLocationService)

ArcGIS.Desktop.Mapping.DeviceLocation Namespace > MapDeviceLocationService Class : ZoomOrPanToCurrentLocation Method
Set to true to zoom.
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, Windows 10, Windows 8.1

See Also

Reference

MapDeviceLocationService Class
MapDeviceLocationService Members