polyline property

Future<List<LatLng>> polyline

路线

Implementation

Future<List<LatLng>> get polyline {
  return platform(
    android: (pool) async {
      final polyline = await _androidModel.getPolyline();
      final latitudeBatch = await polyline.getLatitude_batch();
      final longitudeBatch = await polyline.getLongitude_batch();
      return [
        for (int i = 0; i < polyline.length; i++)
          LatLng(latitudeBatch[i], longitudeBatch[i])
      ];
    },
    ios: (pool) async {
      final latLngString = await _iosModel.get_polyline();
      return latLngString
          .split(';')
          .map((latLngPair) => latLngPair.split(','))
          .map((it) => LatLng(double.parse(it[1]), double.parse(it[0])))
          .toList();
    },
  );
}