unproject method

Future<Map<String?, Object?>> unproject(
  1. MercatorCoordinate arg_coordinate,
  2. double arg_zoomScale
)

Calculate a coordinate for a given point on the map in Mercator Projection.

@param coordinate Point on the map in Mercator projection. @param zoomScale The current zoom factor applied on the map, is used to calculate the world size as tileSize * zoomScale (i.e., 512 * 2 ^ Zoom level) where tileSize is the width of a tile in pixels.

@return Returns a coordinate.

Implementation

Future<Map<String?, Object?>> unproject(
    MercatorCoordinate arg_coordinate, double arg_zoomScale) async {
  final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
      'dev.flutter.pigeon.mapbox_maps_flutter.Projection.unproject', codec,
      binaryMessenger: _binaryMessenger);
  final List<Object?>? replyList = await channel
      .send(<Object?>[arg_coordinate, arg_zoomScale]) as List<Object?>?;
  if (replyList == null) {
    throw PlatformException(
      code: 'channel-error',
      message: 'Unable to establish connection on channel.',
    );
  } else if (replyList.length > 1) {
    throw PlatformException(
      code: replyList[0]! as String,
      message: replyList[1] as String?,
      details: replyList[2],
    );
  } else if (replyList[0] == null) {
    throw PlatformException(
      code: 'null-error',
      message: 'Host platform returned null value for non-null return value.',
    );
  } else {
    return (replyList[0] as Map<Object?, Object?>?)!.cast<String?, Object?>();
  }
}