distanceSearch method

Future<List<int>> distanceSearch(
  1. List<LatLng> origins,
  2. LatLng target,
  3. DistanceSearchType type
)

距离测量 参考链接

type 分别对应

Implementation

Future<List<int>> distanceSearch(List<LatLng> origins, LatLng target, DistanceSearchType type) async {
  List<Map<String, dynamic>> oriList = [];

  origins.forEach((o) {
    oriList.add(o.toJson());
  });

  Map<String, dynamic> params = {
    "origin": oriList,
    "target": target.toJson(),
    "type": DistanceSearchType.values.indexOf(type),
  };

  List<dynamic> result = await _searchChannel.invokeMethod("tool#distanceSearch", params);
  return result.map((v) => v as int).toList();
}