pixelBoundsAtZoom method

Bounds<double> pixelBoundsAtZoom(
  1. double zoom
)

Calculates the pixel bounds of this MapCamera at the given zoom.

Implementation

Bounds<double> pixelBoundsAtZoom(double zoom) {
  var halfSize = size / 2;
  if (zoom != this.zoom) {
    final scale = getZoomScale(this.zoom, zoom);
    halfSize = size / (scale * 2);
  }
  final pixelCenter = project(center, zoom).floor().toDoublePoint();
  return Bounds(pixelCenter - halfSize, pixelCenter + halfSize);
}