ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Core.DeviceLocation Namespace / IDeviceLocationService Interface / GetProperties Method
Example

In This Topic
    GetProperties Method (IDeviceLocationService)
    In This Topic
    Gets the current DeviceLocationProperties being used.
    Syntax
    Example
    Get Current Device Location Source and Properties
    {
      // Check if a device is connected
      bool isConnected = DeviceLocationService.Instance.IsDeviceConnected();
      if (!isConnected)
      {
        return; // no device connected
      }
      // Get the current device location source
      var src = DeviceLocationService.Instance.GetSource();
      // Check if the source is a SerialPortDeviceLocationSource
      //Set values for the SerialPortDeviceLocationSource
      if (src is SerialPortDeviceLocationSource serialPortSrc)
      {
        var port = serialPortSrc.ComPort;
        var antennaHeight = serialPortSrc.AntennaHeight;
        var dataBits = serialPortSrc.DataBits;
        var baudRate = serialPortSrc.BaudRate;
        var parity = serialPortSrc.Parity;
        var stopBits = serialPortSrc.StopBits;
    
        var sr = await QueuedTask.Run(() =>
        {
          return serialPortSrc.GetSpatialReference();
        });
    
      }
      //Get current device location properties being used.
      var dlProps = DeviceLocationService.Instance.GetProperties();
      var accuracy = dlProps.AccuracyThreshold;
    }
    Update Properties on the Current Device Location Source
    {
      await QueuedTask.Run(() =>
      {
        // Get the current device location properties
        var dlProps = DeviceLocationService.Instance.GetProperties();
        //Change the accuracy threshold
        dlProps.AccuracyThreshold = 22.5; // meters
                                          // Update the properties on the device location source
        DeviceLocationService.Instance.UpdateProperties(dlProps);
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also