ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping.DeviceLocation Namespace / MapDeviceLocationOptions Class / NavigationMode Property
Example

In This Topic
    NavigationMode Property
    In This Topic
    Gets and sets the current MappingDeviceLocationNavigationMode for the active map view.
    Syntax
    public MappingDeviceLocationNavigationMode NavigationMode {get; set;}
    Public Property NavigationMode As MappingDeviceLocationNavigationMode
    Remarks
    NavigationMode controls the location of the device within the map view.
    Zooming or panning the map interactively cancels the NavigationMode and sets it to MappingDeviceLocationNavigationMode.None
    Example
    Get Current Map Device Location Options
    var options = MapDeviceLocationService.Instance.GetDeviceLocationOptions();
    
    var visibility = options.DeviceLocationVisibility;
    var navMode = options.NavigationMode;
    var trackUp = options.TrackUpNavigation;
    var showBuffer = options.ShowAccuracyBuffer;
    
    Set map view to always be centered on the device location
    var currentOptions = MapDeviceLocationService.Instance.GetDeviceLocationOptions();
    if (currentOptions == null)
      return;
    
    currentOptions.DeviceLocationVisibility = true;
    currentOptions.NavigationMode = MappingDeviceLocationNavigationMode.KeepAtCenter;
    
    await QueuedTask.Run(() =>
    {
      MapDeviceLocationService.Instance.SetDeviceLocationOptions(currentOptions);
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also