surfaceSections property

List<SurfaceSection> get surfaceSections

Get list of route surface sections.

Each section has the start distance from route start and the surface type (see SurfaceType).

The end of the section is the distance from start of the next section or route total length (for the last section)

Returns

  • The surface sections list

Throws

  • An exception if it fails.

Implementation

List<SurfaceSection> get surfaceSections {
  final OperationResult resultString = objectMethod(
    _pointerId,
    'RouteTerrainProfile',
    'getSurfaceSections',
  );

  final List<dynamic> listJson = resultString['result'];
  final List<SurfaceSection> retList = listJson
      .map(
        (final dynamic categoryJson) => SurfaceSection.fromJson(categoryJson),
      )
      .toList();
  return retList;
}