MPCameraUpdate.fromBounds constructor

MPCameraUpdate.fromBounds({
  1. required MPBounds bounds,
  2. required int padding,
  3. int? width,
  4. int? height,
})

Construct the update from a bounding box with some padding.

Implementation

MPCameraUpdate.fromBounds(
    {required MPBounds bounds, required int padding, int? width, int? height})
    : _map = {
        "mode": "fromBounds",
        "bounds": bounds.toJson(),
        "padding": padding,
        "width": width,
        "height": height
      } {
  _map.removeWhere((key, value) => value == null);
}