latLngBounds property

MapLatLngBounds? get latLngBounds

Specifies the current latlng bounds of the maps. The maps zoom level and focalLatLng get updated based on the given bounds.

For dynamic changes, the bounds value get updated with an animation.If both latLngBounds and MapTileLayer.initialLatLngBounds or MapShapeLayer.initialLatLngBounds are given, considered latLngBounds values as load time value.

Implementation

MapLatLngBounds? get latLngBounds => _latLngBounds;
set latLngBounds (MapLatLngBounds? value)

Implementation

set latLngBounds(MapLatLngBounds? value) {
  if (_latLngBounds == value) {
    return;
  }

  _latLngBounds = value;
  if (_controller != null) {
    zoomLevel = getZoomLevel(_latLngBounds!, _controller!.layerType!,
            renderBox.size, _controller!.shapeLayerSizeFactor / zoomLevel)
        .clamp(minZoomLevel, maxZoomLevel);
    focalLatLng = getFocalLatLng(_latLngBounds!);
  }
}