MapboxMap constructor

MapboxMap({
  1. required _MapboxMapsPlatform mapboxMapsPlatform,
  2. OnStyleLoadedListener? onStyleLoadedListener,
  3. OnCameraChangeListener? onCameraChangeListener,
  4. OnMapIdleListener? onMapIdleListener,
  5. OnMapLoadedListener? onMapLoadedListener,
  6. OnMapLoadErrorListener? onMapLoadErrorListener,
  7. OnRenderFrameStartedListener? onRenderFrameStartedListener,
  8. OnRenderFrameFinishedListener? onRenderFrameFinishedListener,
  9. OnSourceAddedListener? onSourceAddedListener,
  10. OnSourceDataLoadedListener? onSourceDataLoadedListener,
  11. OnSourceRemovedListener? onSourceRemovedListener,
  12. OnStyleDataLoadedListener? onStyleDataLoadedListener,
  13. OnStyleImageMissingListener? onStyleImageMissingListener,
  14. OnStyleImageUnusedListener? onStyleImageUnusedListener,
  15. OnMapTapListener? onMapTapListener,
  16. OnMapLongTapListener? onMapLongTapListener,
  17. OnMapScrollListener? onMapScrollListener,
})

Implementation

MapboxMap({
  required _MapboxMapsPlatform mapboxMapsPlatform,
  this.onStyleLoadedListener,
  this.onCameraChangeListener,
  this.onMapIdleListener,
  this.onMapLoadedListener,
  this.onMapLoadErrorListener,
  this.onRenderFrameStartedListener,
  this.onRenderFrameFinishedListener,
  this.onSourceAddedListener,
  this.onSourceDataLoadedListener,
  this.onSourceRemovedListener,
  this.onStyleDataLoadedListener,
  this.onStyleImageMissingListener,
  this.onStyleImageUnusedListener,
  this.onMapTapListener,
  this.onMapLongTapListener,
  this.onMapScrollListener,
}) : _mapboxMapsPlatform = mapboxMapsPlatform {
  _proxyBinaryMessenger = _mapboxMapsPlatform.binaryMessenger;

  annotations = _AnnotationManager(mapboxMapsPlatform: _mapboxMapsPlatform);
  if (onStyleLoadedListener != null) {
    _mapboxMapsPlatform.onStyleLoadedPlatform.add((argument) {
      onStyleLoadedListener?.call(argument);
    });
  }
  if (onCameraChangeListener != null) {
    _mapboxMapsPlatform.onCameraChangeListenerPlatform.add((argument) {
      onCameraChangeListener?.call(argument);
    });
  }
  if (onMapIdleListener != null) {
    _mapboxMapsPlatform.onMapIdlePlatform.add((argument) {
      onMapIdleListener?.call(argument);
    });
  }
  if (onMapLoadedListener != null) {
    _mapboxMapsPlatform.onMapLoadedPlatform.add((argument) {
      onMapLoadedListener?.call(argument);
    });
  }
  if (onMapLoadErrorListener != null) {
    _mapboxMapsPlatform.onMapLoadErrorPlatform.add((argument) {
      onMapLoadErrorListener?.call(argument);
    });
  }
  if (onRenderFrameFinishedListener != null) {
    _mapboxMapsPlatform.onRenderFrameFinishedPlatform.add((argument) {
      onRenderFrameFinishedListener?.call(argument);
    });
  }
  if (onRenderFrameStartedListener != null) {
    _mapboxMapsPlatform.onRenderFrameStartedPlatform.add((argument) {
      onRenderFrameStartedListener?.call(argument);
    });
  }
  if (onSourceAddedListener != null) {
    _mapboxMapsPlatform.onSourceAddedPlatform.add((argument) {
      onSourceAddedListener?.call(argument);
    });
  }
  if (onSourceDataLoadedListener != null) {
    _mapboxMapsPlatform.onSourceDataLoadedPlatform.add((argument) {
      onSourceDataLoadedListener?.call(argument);
    });
  }
  if (onSourceRemovedListener != null) {
    _mapboxMapsPlatform.onSourceRemovedPlatform.add((argument) {
      onSourceRemovedListener?.call(argument);
    });
  }
  if (onStyleDataLoadedListener != null) {
    _mapboxMapsPlatform.onStyleDataLoadedPlatform.add((argument) {
      onStyleDataLoadedListener?.call(argument);
    });
  }
  if (onStyleImageMissingListener != null) {
    _mapboxMapsPlatform.onStyleImageMissingPlatform.add((argument) {
      onStyleImageMissingListener?.call(argument);
    });
  }
  if (onStyleImageUnusedListener != null) {
    _mapboxMapsPlatform.onStyleImageUnusedPlatform.add((argument) {
      onStyleImageUnusedListener?.call(argument);
    });
  }
  _setupGestures();
}