onScaleUpdate method

dynamic onScaleUpdate(
  1. ScaleUpdateDetails details
)

On Change Scale

Implementation

onScaleUpdate(ScaleUpdateDetails details) {
  final scaleDiff = details.scale - _scaleStart;
  _scaleStart = details.scale;

  if (scaleDiff > 0) {
    ctMap.zoom += 0.02;
  } else if (scaleDiff < 0) {
    ctMap.zoom -= 0.02;
  } else {
    final now = details.focalPoint;
    final diff = now - (_dragStart ?? Offset(0, 0));
    _dragStart = now;
    ctMap.drag(diff.dx, diff.dy);
  }
}