getVisibleRegion method

  1. @override
Future<LatLngBounds> getVisibleRegion()
override

Implementation

@override
Future<LatLngBounds> getVisibleRegion() async {
  try {
    final Map<dynamic, dynamic> reply =
        await _channel.invokeMethod('map#getVisibleRegion', null);
    final southwest = reply['sw'] as List<dynamic>;
    final northeast = reply['ne'] as List<dynamic>;
    return LatLngBounds(
      southwest: LatLng(southwest[0], southwest[1]),
      northeast: LatLng(northeast[0], northeast[1]),
    );
  } on PlatformException catch (e) {
    return new Future.error(e);
  }
}