setZoomInPlace method

void setZoomInPlace(
  1. double zoom,
  2. Offset position
)

In-place zoom.

Implementation

void setZoomInPlace(double zoom, Offset position) {
  final before = toLatLng(position);

  controller.zoom = zoom;

  final after = toOffset(before);

  final diffx = position.dx - after.dx;
  final diffy = position.dy - after.dy;

  drag(diffx, diffy);
}