exportAs method

String exportAs(
  1. PathFileFormat format
)

Export route data in a standard file format.

Serializes route data into the requested format (for example GPX or KML) and returns the resulting file contents as a UTF-8 string.

Parameters

Returns

  • A String containing the exported route data in the requested format.

Implementation

String exportAs(final PathFileFormat format) {
  final OperationResult resultString = objectMethod(
    pointerId,
    'RouteBase',
    'exportAs',
    args: format.index,
  );

  final String encodedResult = resultString['result'];
  final Uint8List resultAsUint8List = base64Decode(encodedResult);
  final String result = utf8.decode(resultAsUint8List);

  return result;
}