GoogleMapsController constructor

GoogleMapsController({
  1. void onMapCreated(
    1. GoogleMapController
    ) = _voidFunctionOneParameter,
  2. void onCameraIdle() = _voidFunction,
  3. void onCameraMove(
    1. CameraPosition
    ) = _voidFunctionOneParameter,
  4. void onCameraMoveStarted() = _voidFunction,
  5. void onLongPress(
    1. LatLng
    ) = _voidFunctionOneParameter,
  6. void onTap(
    1. LatLng
    ) = _voidFunctionOneParameter,
  7. CameraPosition? initialCameraPosition,
  8. Set<Circle>? initialCircles,
  9. Set<Marker>? initialMarkers,
  10. Set<Polygon>? initialPolygons,
  11. Set<Polyline>? initialPolylines,
  12. bool buildingsEnabled = true,
  13. CameraTargetBounds cameraTargetBounds = CameraTargetBounds.unbounded,
  14. bool compassEnabled = true,
  15. bool indoorViewEnabled = false,
  16. bool liteModeEnabled = false,
  17. bool zoomControlsEnabled = true,
  18. bool mapToolbarEnabled = true,
  19. MapType mapType = MapType.normal,
  20. MinMaxZoomPreference minMaxZoomPreference = MinMaxZoomPreference.unbounded,
  21. bool myLocationEnabled = false,
  22. bool myLocationButtonEnabled = true,
  23. EdgeInsets padding = const EdgeInsets.all(0),
  24. bool rotateGesturesEnabled = true,
  25. bool scrollGesturesEnabled = true,
  26. bool tiltGesturesEnabled = true,
  27. bool trafficEnabled = false,
  28. bool zoomGesturesEnabled = true,
  29. List<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
})

Implementation

GoogleMapsController({
  // Events
  void Function(GoogleMapController) onMapCreated = _voidFunctionOneParameter,
  void Function() onCameraIdle = _voidFunction,
  void Function(CameraPosition) onCameraMove = _voidFunctionOneParameter,
  void Function() onCameraMoveStarted = _voidFunction,
  void Function(LatLng) onLongPress = _voidFunctionOneParameter,
  void Function(LatLng) onTap = _voidFunctionOneParameter,

  // Initials
  CameraPosition? initialCameraPosition,
  Set<Circle>? initialCircles,
  Set<Marker>? initialMarkers,
  Set<Polygon>? initialPolygons,
  Set<Polyline>? initialPolylines,
  bool buildingsEnabled = true,
  CameraTargetBounds cameraTargetBounds = CameraTargetBounds.unbounded,
  bool compassEnabled = true,
  bool indoorViewEnabled = false,
  bool liteModeEnabled = false,
  bool zoomControlsEnabled = true,
  bool mapToolbarEnabled = true,
  MapType mapType = MapType.normal,
  MinMaxZoomPreference minMaxZoomPreference = MinMaxZoomPreference.unbounded,
  bool myLocationEnabled = false,
  bool myLocationButtonEnabled = true,
  EdgeInsets padding = const EdgeInsets.all(0),
  bool rotateGesturesEnabled = true,
  bool scrollGesturesEnabled = true,
  bool tiltGesturesEnabled = true,
  bool trafficEnabled = false,
  bool zoomGesturesEnabled = true,
  List<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
})  : this.initialCameraPosition = initialCameraPosition ??
          const CameraPosition(
            target: LatLng(0, 0),
            zoom: 15,
          ),
      this._circles = initialCircles ?? Set(),
      this._polygons = initialPolygons ?? Set(),
      this._polylines = initialPolylines ?? Set(),
      this._markers = initialMarkers ?? Set(),
      this._buildingsEnabled = buildingsEnabled,
      this._cameraTargetBounds = cameraTargetBounds,
      this._compassEnabled = compassEnabled,
      this._indoorViewEnabled = indoorViewEnabled,
      this._liteModeEnabled = liteModeEnabled,
      this._zoomControlsEnabled = zoomControlsEnabled,
      this._mapToolbarEnabled = mapToolbarEnabled,
      this._mapType = mapType,
      this._minMaxZoomPreference = minMaxZoomPreference,
      this._myLocationEnabled = myLocationEnabled,
      this._myLocationButtonEnabled = myLocationButtonEnabled,
      this._padding = padding,
      this._rotateGesturesEnabled = rotateGesturesEnabled,
      this._scrollGesturesEnabled = scrollGesturesEnabled,
      this._tiltGesturesEnabled = tiltGesturesEnabled,
      this._trafficEnabled = trafficEnabled,
      this._gestureRecognizers = gestureRecognizers?.toSet() ??
          {
            Factory<OneSequenceGestureRecognizer>(
              () => EagerGestureRecognizer(),
            ),
          },
      this._zoomGesturesEnabled = zoomGesturesEnabled {
  this._onCameraIdle = () {
    _onCameraIdle$.add(null);
    onCameraIdle();
  };
  this._onCameraMoveStarted = () {
    _onCameraMoveStarted$.add(null);
    onCameraMoveStarted();
  };
  this._onCameraMove = (cameraPosition) {
    _onCameraMove$.add(cameraPosition);
    onCameraMove(cameraPosition);
  };
  this._onLongPress = (latlng) {
    _onLongPress$.add(latlng);
    onLongPress(latlng);
  };
  this._onTap = (latlng) {
    _onTap$.add(latlng);
    onTap(latlng);
  };
  this._onMapCreated = (googleMapsController) {
    init(googleMapsController);
    onMapCreated(googleMapsController);
  };
}