getVisibleRegion method

  1. @override
Future<LatLngBounds> getVisibleRegion({
  1. required int mapId,
})
override

Return the region that is visible in a map.

Implementation

@override
Future<LatLngBounds> getVisibleRegion({
  required int mapId,
}) async {
  final Map<String, dynamic> latLngBounds = (await channel(mapId)
      .invokeMapMethod<String, dynamic>('map#getVisibleRegion'))!;
  final LatLng southwest = LatLng.fromJson(latLngBounds['southwest'])!;
  final LatLng northeast = LatLng.fromJson(latLngBounds['northeast'])!;

  return LatLngBounds(northeast: northeast, southwest: southwest);
}