ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Core.DeviceLocation Namespace / DeviceLocationService Class
Members Example

In This Topic
    DeviceLocationService Class
    In This Topic
    Represents the device location service for connecting to GPS/GNSS devices.
    Object Model
    DeviceLocationService ClassSnapshot ClassDeviceLocationProperties ClassDeviceLocationSource ClassIDeviceLocationService Interface
    Syntax
    public sealed class DeviceLocationService : IDeviceLocationService  
    Public NotInheritable Class DeviceLocationService 
       Implements IDeviceLocationService 
    Remarks
    There can only be one device location source open at any one time.

    You cannot create a DeviceLocationService instance. Instead use the Instance property to access the singleton DeviceLocationService instance which will have been already created.

    Subscribe to ArcGIS.Desktop.Core.DeviceLocation.Events.SnapshotChangedEvent event to receive coordinates and metadata from the open device location source Snapshot.

    To interact with the current or active map view using the device location, use the ArcGIS.Desktop.Mapping.DeviceLocation.MapDeviceLocationService instance.

    Subscribe to the ArcGIS.Desktop.Core.DeviceLocation.Events.DeviceLocationSourceChangedEvent to receive notifications when the current device location source is changed.

    Example
    var sp = new SerialPortDeviceLocationSource()
    {
      ComPort = "COM4",
    };
                
    await QueuedTask.Run(() =>
    {
      DeviceLocationService.Instance.Open(sp);
    });
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Core.DeviceLocation.DeviceLocationService

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also