startTrackPositions method
- required int updatePositionMs,
- required MarkerCollectionRenderSettings settings,
- DataSource? dataSource,
Start improved position tracking and render a marker polyline for tracked positions.
This method enables an enhanced visualization that draws a polyline between
relevant map link points for positions provided by a sense data source. The
visualization is updated at the requested frequency and uses the supplied
rendering settings.
Parameters
updatePositionMs: Update interval in milliseconds for the tracked positions. High frequency values may reduce rendering performance on low-end devices.settings: Marker collection rendering settings used to draw the tracked positions on the map view.dataSource: Optional DataSource whose positions will be tracked. If null, the PositionService's default data source is used when available.
Returns
- GemError.success on success.
- GemError.notFound when no data source is available and none was provided.
- Other GemError values for platform-specific errors.
Also see:
- stopTrackPositions — Stop the improved position tracking visualization.
- trackedPositions — Get the current tracked positions.
- isTrackedPositions — Check if position tracking is currently active.
Implementation
GemError startTrackPositions({
required int updatePositionMs,
required MarkerCollectionRenderSettings settings,
DataSource? dataSource,
}) {
final OperationResult resultString = objectMethod(
_pointerId,
'MapViewExtensions',
'startTrackPositions',
args: <String, Object>{
'updatePositionMs': updatePositionMs,
'settings': settings,
if (dataSource != null) 'dataSource': dataSource.pointerId,
},
dependencyId: _mapControllerId,
);
return GemErrorExtension.fromCode(resultString['result']);
}