drawRoadManually method

  1. @override
Future<void> drawRoadManually(
  1. int idOSM,
  2. String roadKey,
  3. List<GeoPoint> road,
  4. RoadOption roadOption,
)
override

Implementation

@override
Future<void> drawRoadManually(
  int idOSM,
  String roadKey,
  List<GeoPoint> road,
  RoadOption roadOption,
) async {
  final coordinates = road.map((e) => e.toListNum()).toList();
  final encodedCoordinates = encodePolyline(coordinates);
  Map<String, dynamic> data = {
    'key': roadKey,
    "road": encodedCoordinates,
    "roadWidth": roadOption.roadWidth,
  };
  data.addAll(Map.from(roadOption.toMap()));

  await _channels[idOSM]?.invokeMethod(
    "drawRoad#manually",
    data,
  );
}