start method
GemError
start({
- required GemMapController controller,
- required Path track,
- required String outputPath,
- ActivityVideoPreviewSettings settings = const ActivityVideoPreviewSettings(),
- required void onComplete(
- GemError error
- void onProgress(
- int progress
Starts rendering the fly-over video of track on the map of controller.
The render runs asynchronously: onProgress reports its progress and onComplete its
outcome. A failed or cancelled render leaves the partial file at outputPath in place.
Parameters
controller: The map used for rendering. It must stay mounted and visible until the render completes.track: The recorded track to fly over.outputPath: The path of the MP4 file to write.settings: The render settings. Defaults to the native defaults.onComplete: Callback invoked once when the render finishes, unless the renderer is disposed first. The function is called with:error- GemError.success when the video was written, GemError.cancel after cancel, GemError.invalidated when the map was removed, GemError.operationTimeout when the map stopped rendering, or another GemError on failure (see lastErrorDetails).
onProgress: Optional callback invoked with the render progress, from 0 to 100.
Returns
- GemError.success when the render started. Any other value means nothing started and
onCompleteis not called:- GemError.inUse when the previous render of this renderer has not called its
onCompleteyet, or another renderer is rendering on the same map. - GemError.invalidInput when the track is unusable (a single point or shorter than 20 meters) or the map is not available.
- GemError.notSupported when the platform has no video encoder.
- GemError.missingCapability when the renderer is not available in this SDK.
- GemError.internalAbort when the render could not be scheduled.
- GemError.inUse when the previous render of this renderer has not called its
See also:
- startIntroImage - Render only the opening overview as a picture.
- cancel - Cancel the render in progress.
- lastErrorDetails - Platform detail about a failed render.
Implementation
GemError start({
required GemMapController controller,
required Path track,
required String outputPath,
ActivityVideoPreviewSettings settings =
const ActivityVideoPreviewSettings(),
required void Function(GemError error) onComplete,
void Function(int progress)? onProgress,
}) {
return _start(
'start',
_renderArgs(controller, track, outputPath, settings),
onComplete,
onProgress,
);
}