GetCurrentSnapshot Method (DeviceLocationService)
Returns the most recent snapshot received from the open device location source.
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
graphicsLayer.ClearSelection();
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.