ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping.DeviceLocation Namespace / MapDeviceLocationOptions Class / MapDeviceLocationOptions Constructor
Example

In This Topic
    MapDeviceLocationOptions Constructor
    In This Topic
    Create a new MapDeviceLocationOptions instance.
    Syntax
    Public Function New()
    public MapDeviceLocationOptions()
    Remarks
    Use this with SetDeviceLocationOptions to update the current device location source with new options.
    Example
    Set Current Map Device Location Options
    {
        //Note: Run within a QueuedTask
        //Check there is a source first...
        if (DeviceLocationService.Instance.GetSource() == null)
            //Setting DeviceLocationOptions w/ no Device Location Source
            //Will throw an InvalidOperationException
            return;
    
        if (!MapDeviceLocationService.Instance.IsDeviceLocationEnabled)
            //Setting DeviceLocationOptions w/ no Device Location Enabled
            //Will throw an InvalidOperationException
            return;
    
        MapDeviceLocationService.Instance.SetDeviceLocationOptions(
          new MapDeviceLocationOptions()
          {
              DeviceLocationVisibility = true,
              NavigationMode = MappingDeviceLocationNavigationMode.KeepAtCenter,
              TrackUpNavigation = true
          });
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also