ArcGIS Pro 2.8 API Reference Guide
MapDeviceLocationService Class
Members  Example 

ArcGIS.Desktop.Mapping.DeviceLocation Namespace : MapDeviceLocationService Class
The Map Device Location Service will interact with the active map using the current open device location source, such as a GPS/GNSS device.
Object Model
MapDeviceLocationService ClassMapDeviceLocationOptions ClassIMapDeviceLocationService Interface
Syntax
public class MapDeviceLocationService : IMapDeviceLocationService  
Public Class MapDeviceLocationService 
   Implements IMapDeviceLocationService 
Remarks
The MapDeviceLocationService is a singleton. To access the service use its Instance property. Once connected, the service allows you to zoom or pan to the current location received from your device. Use the service to show/hide the location, adjust the accuracy buffer on the map, interactively Zoom or pan the current map view, and adjust how the map view responds to the current device location. The map view can either be kept centered on the location or rotated to "track" the location always keeping the location heading orientated to the top of the screen. Refer to SetDeviceLocationOptions

To connect to a location device refer to ArcGIS.Desktop.Core.DeviceLocation.DeviceLocationService.Open

Example
var currentOptions = MapDeviceLocationService.Instance.GetDeviceLocationOptions();
if (currentOptions == null)
  return;
            
currentOptions.DeviceLocationVisibility = true;
currentOptions.NavigationMode = MappingDeviceLocationNavigationMode.KeepAtCenter;
            
await QueuedTask.Run(() =>
{
  MapDeviceLocationService.Instance.SetDeviceLocationOptions(currentOptions);
});
await QueuedTask.Run(() =>
{
  MapDeviceLocationService.Instance.ZoomOrPanToCurrentLocation(true);
});
Inheritance Hierarchy

System.Object
   ArcGIS.Desktop.Mapping.DeviceLocation.MapDeviceLocationService

Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

MapDeviceLocationService Members
ArcGIS.Desktop.Mapping.DeviceLocation Namespace