Path.fromCoordinatesWaypoints constructor

Path.fromCoordinatesWaypoints({
  1. required List<Coordinates> coordinates,
  2. required List<int> waypoints,
})

Create a path from list of coordinates and waypoints.

Parameters

  • IN coords List of coordinates
  • IN waypoints List of waypoints (indexes in the coordinates list)

Returns

  • The created path

Implementation

factory Path.fromCoordinatesWaypoints(
    {required List<Coordinates> coordinates, required List<int> waypoints}) {
  final String resultString = GemKitPlatform.instance.callCreateObject(
    jsonEncode(<String, Object>{
      'class': 'Path',
      'args': <String, dynamic>{
        'coords': coordinates,
        'waypoints': waypoints,
      },
    }),
  );
  final dynamic decodedVal = jsonDecode(resultString);

  return Path.init(decodedVal['result']);
}