routeSearch static method
线路规划 默认返回线路+费用(过路费+时间+距离..)
Implementation
static Future<void> routeSearch({
required List<LatLng> wayPoints,
int? strategy ,
int? showFields = ShowFields.POLINE + ShowFields.COST,//ShowFields.
bool onlyOne = true,//只返回第一条线路
bool simplify = true,//简化数据
RouteResultBack? back,
}) async {
final String? jsonStr = await _channel.invokeMethod('routeSearch', {
"wayPointsJson": json.encode(wayPoints),
"strategy": strategy??DrivingStrategy.DEFAULT,
"showFields": showFields,
"onlyOne": onlyOne,
"simplify":simplify,
});
if (jsonStr != null) {
if(jsonStr.endsWith("FORCED_END")) return;
Map? map = json.decode(jsonStr);
if (map != null && back != null) {
back(map['code'] as int, RouteResult.fromJson(map["data"]));
}
}
}