getProjectedBounds method

  1. @override
Rect? getProjectedBounds(
  1. double zoom
)
override

Rescales the bounds to a given zoom value.

Implementation

@override
Rect? getProjectedBounds(double zoom) {
  if (infinite) return null;

  final b = projection.bounds!;
  final zoomScale = scale(zoom);

  final transformation = _getTransformationByZoom(zoom);
  final (minx, miny) =
      transformation.transform(b.min.dx, b.min.dy, zoomScale);
  final (maxx, maxy) =
      transformation.transform(b.max.dx, b.max.dy, zoomScale);
  return Rect.fromPoints(Offset(minx, miny), Offset(maxx, maxy));
}