moveCamera method

  1. @override
void moveCamera(
  1. LatLng location,
  2. double? zoom
)
override

Moves the camera to location, keeping the current zoom when zoom is null.

Attribution applies as it does to fitBounds.

Implementation

@override
void moveCamera(latlong.LatLng location, double? zoom) async {
  // Centred in the padded part of the map by the map view itself, which is
  // given the host's padding.
  await _withMap((map) async {
    final currentZoom = await map.getZoomLevel();
    beginProgrammaticMove();
    await map.animateCamera(
      CameraUpdate.newLatLngZoom(
          location.toGoogleMapLatLng(), zoom ?? currentZoom),
    );
  });
}