MapState constructor

MapState({
  1. required MapController controller,
  2. required MapOptions options,
})

Implementation

MapState({
  required MapController controller,
  required MapOptions options,
}) {
  _originalController = controller;
  _originalOptions = options;
  _controller = controller;
  _options = options;
  _zoom = options.zoom;
  _minZoom = options.minZoom;
  _maxZoom = options.maxZoom;
  _originalRotation = options.rotation;
  _rotation = 0.0;
  _size = options.size!;
  _isLocating = false;
  _onChangedListeners = [];

  // prepare for default center when the map uses a string centerQuery
  _center = options.center ?? LatLng(0.0, 0.0);

  _angle = degToRadian(_rotation);
  _controller.onReady = options.onReady;
  _controller.onChanged = options.onChanged;
  _controller.map = this;

  assert(options.slideOnBoundaries ||
      (options.centerQuery != null && options.centerQuery!.isNotEmpty) ||
      (options.center != null && !_isOutOfBounds(options.center)));
}