routeSearch static method
线路规划
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"]));
}
}
}