routeSearch static method

Future<void> routeSearch({
  1. required List<LatLng> wayPoints,
  2. int? strategy,
  3. int? showFields,
  4. bool onlyOne = true,
  5. RouteResultBack? back,
})

线路规划

Implementation

static Future<void> routeSearch({
  required List<LatLng> wayPoints,
  int? strategy ,
  int? showFields,//ShowFields.
  bool onlyOne = true,
  RouteResultBack? back,
}) async {
  final String? jsonStr = await _channel.invokeMethod('routeSearch', {
    "wayPointsJson": json.encode(wayPoints),
    "strategy": strategy??DrivingStrategy.DEFAULT,
    "showFields": showFields,
    "onlyOne": onlyOne,
  });
  if (jsonStr != null) {
    Map? map = json.decode(jsonStr);
    if (map != null && back != null) {
      back(map['code'] as int, RouteResult.fromJson(map["data"]));
    }
  }
}