ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Core.DeviceLocation Namespace / DeviceLocationService Class / GetCurrentSnapshot Method

In This Topic
    GetCurrentSnapshot Method (DeviceLocationService)
    In This Topic
    Returns the most recent snapshot received from the open device location source.
    public Snapshot GetCurrentSnapshot()
    Public Function GetCurrentSnapshot() As Snapshot
    Add the Most Recent Location To A Graphics Layer
    //var graphicsLayer = ... ;
    //Must be on the QueuedTask.Run()
    // get the last location
    var pt = DeviceLocationService.Instance.GetCurrentSnapshot()?.GetPositionAsMapPoint();
    if (pt != null)
      //Create a point symbol
      var ptSymbol = SymbolFactory.Instance.ConstructPointSymbol(
                        CIMColor.CreateRGBColor(125, 125, 0), 10, SimpleMarkerStyle.Triangle);
      //Add a graphic to the graphics layer
      graphicsLayer.AddElement(pt, ptSymbol);
      //unselect it

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also