onPanning method

void onPanning(
  1. MapPanDetails details
)

Called whenever panning is happening.

Subclasses can override this method to do any custom operations based on the details provided in the MapPanDetails. When super.onPanning(details) is not called, panning will not happen.

MapPanDetails contains following properties.

Implementation

void onPanning(MapPanDetails details) {
  if (_controller != null) {
    _latLngBounds = details.newVisibleBounds;
    if (_controller!.layerType == LayerType.shape) {
      _controller!.notifyPanningListeners(details);
      _controller!.notifyListeners();
    } else {
      _controller!
        ..isInInteractive = true
        ..gesture = Gesture.pan
        ..localScale = 1.0
        ..panDistance += details.delta!;
      focalLatLng = details.focalLatLng;
      _controller!.notifyListeners();
    }
  }
}