getPixelBounds method

Bounds getPixelBounds(
  1. LatLng? center,
  2. double zoom
)

Get pixel bounds based on specified center and zoom level.

Implementation

Bounds getPixelBounds(LatLng? center, double zoom) {
  double scale = getZoomScale(zoom, _zoom);

  UPoint centerPoint = getCenterPoint(center, zoom).floor();
  UPoint offset = UPoint.from(_halfSize / scale);

  return Bounds(centerPoint - offset, centerPoint + offset);
}