toScreenLocation method

Future<Point> toScreenLocation(
  1. LatLng coord
)

经纬度坐标转屏幕坐标

Implementation

Future<Point> toScreenLocation(LatLng coord) async {
  return platform(
    android: (pool) async {
      final map = await _androidController.getMap();
      final projection = await map.getProjection();

      final latLng =
          await createcom_amap_api_maps_model_LatLng__double__double(
              coord.latitude, coord.longitude);

      final point = await projection.toScreenLocation(latLng);

      pool..add(map)..add(projection)..add(latLng)..add(point);
      return Point((await point.x).toDouble(), (await point.y).toDouble());
    },
    ios: (pool) async {
      final latLng =
          await createCLLocationCoordinate2D(coord.latitude, coord.longitude);
      final point = await _iosController.convertCoordinateToPointToView(
          latLng, _iosController);

      pool..add(latLng)..add(point);
      return Point((await point.x).toDouble(), (await point.y).toDouble());
    },
  );
}