Parse NMEA sentences and use the results to show device location on the map.
Use case
NMEA sentences can be retrieved from GPS receivers and parsed into a series of coordinates with additional information. Devices without a built-in GPS receiver can retrieve NMEA sentences by using a separate GPS dongle, commonly connected bluetooth or through a serial port.
The NMEA location data source allows for detailed interrogation of the information coming from the GPS receiver. For example, allowing you to report the number of satellites in view.
How to use the sample
Tap "Start" to parse the NMEA sentences into a simulated location data source, and initiate the location display. Tap "Recenter" to recenter the location display. Tap "Reset" to reset the location display.
How it works
- Load NMEA sentences from a local file.
- Parse the NMEA sentence strings, and push data into
NmeaLocationDataSource
. - Set the
NmeaLocationDataSource
to the location display's data source. - Start the location display to begin receiving location and satellite updates.
Relevant API
- Location
- LocationDisplay
- NmeaLocationDataSource
- NmeaSatelliteInfo
About the data
A list of NMEA sentences is used to initialize a to simulate a stream of NMEA data. This simulated data source provides NMEA data periodically, and allows the sample to be used on devices without a GPS dongle that produces NMEA data.
The route taken in this sample features a 2-minute driving trip around Redlands, CA.
Additional information
Below is a list of protocol strings for commonly used GNSS external accessories. Please refer to the ArcGIS Field Maps documentation for model and firmware requirements.
Supported by this sample
- com.bad-elf.gps
- com.eos-gnss.positioningsource
- com.geneq.sxbluegpssource
Others
- com.amanenterprises.nmeasource
- com.dualav.xgps150
- com.garmin.pvt
- com.junipersys.geode
- com.leica-geosystems.zeno.gnss
- com.searanllc.serial
- com.trimble.correction, com.trimble.command (1)
(1) Some Trimble models require a proprietary SDK for NMEA output.
Tags
dongle, GNSS, GPS, history, navigation, NMEA, real-time, RTK, trace
Sample Code
<UserControl x:Class="ArcGISRuntime.WinUI.Samples.LocationWithNMEA.LocationWithNMEA"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
<Grid>
<esriUI:MapView x:Name="MyMapView" />
<Border Style="{StaticResource BorderStyle}">
<StackPanel>
<TextBlock x:Name="AccuracyLabel" Text="Press start to begin." />
<TextBlock x:Name="CountLabel" />
<TextBlock x:Name="SatellitesLabel" />
<TextBlock x:Name="SystemLabel" />
<TextBlock x:Name="NmeaMessageLabel" />
<StackPanel Orientation="Horizontal">
<Button Margin="5"
Click="StartClick"
Content="Start" />
<Button Margin="5"
Click="ResetClick"
Content="Reset" />
</StackPanel>
</StackPanel>
</Border>
</Grid>
</UserControl>