NmeaLocationDataSource.withProvider constructor

NmeaLocationDataSource.withProvider(
  1. FutureOr<NmeaDataProvider> generateNmeaDataProvider(), {
  2. SpatialReference? receiverSpatialReference,
  3. SpatialReference? outputSpatialReference,
  4. DatumTransformation? outputDatumTransformation,
})

Creates an NMEA data source object with a function that provides NmeaDataProvider objects.

Locations created from an NMEA data source object instantiated with this constructor will be projected from the SpatialReference defined by the receiverSpatialReference parameter to the SpatialReference defined by the outputSpatialReference parameter using the outputDatumTransformation. If the outputSpatialReference parameter is null the locations will not be projected and the locations will be in the receiverSpatialReference, if the outputDatumTransformation parameter is set it will be ignored. This constructor can be used when a receiver is outputting locations in a SpatialReference other than WGS84, such as when using a reference base station, and/or the application requires the output locations to be projected to a different SpatialReference using a DatumTransformation.

Every time the location data source is started, it will ask for an NmeaDataProvider by calling the function provided in the constructor. The function must return an instance that is fully initialized and generating NMEA messages.

When stopped, the location data source cancels its subscription to the NmeaDataProvider.nmeaData stream and releases the reference to the provider.

Parameters: