getElevation method

Future<double?> getElevation(
  1. Map<String?, Object?> arg_coordinate
)

Get elevation for the given coordinate. Note: Elevation is only available for the visible region on the screen.

@param coordinate defined as longitude-latitude pair.

@return Elevation (in meters) multiplied by current terrain exaggeration, or empty if elevation for the coordinate is not available.

Implementation

Future<double?> getElevation(Map<String?, Object?> arg_coordinate) async {
  final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
      'dev.flutter.pigeon.mapbox_maps_flutter.MapSnapshotter.getElevation',
      codec,
      binaryMessenger: _binaryMessenger);
  final List<Object?>? replyList =
      await channel.send(<Object?>[arg_coordinate]) 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 {
    return (replyList[0] as double?);
  }
}