MapHeroMap constructor

MapHeroMap({
  1. Key? key,
  2. required CameraPosition initialCameraPosition,
  3. String styleString = MapHeroStyles.demo,
  4. String? token,
  5. MapCreatedCallback? onMapCreated,
  6. OnStyleLoadedCallback? onStyleLoadedCallback,
  7. Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
  8. bool compassEnabled = true,
  9. CameraTargetBounds cameraTargetBounds = CameraTargetBounds.unbounded,
  10. MinMaxZoomPreference minMaxZoomPreference = MinMaxZoomPreference.unbounded,
  11. bool rotateGesturesEnabled = true,
  12. bool scrollGesturesEnabled = true,
  13. bool zoomGesturesEnabled = true,
  14. bool tiltGesturesEnabled = true,
  15. bool? doubleClickZoomEnabled,
  16. bool dragEnabled = true,
  17. bool trackCameraPosition = false,
  18. bool myLocationEnabled = false,
  19. MyLocationTrackingMode myLocationTrackingMode = MyLocationTrackingMode.none,
  20. MyLocationRenderMode myLocationRenderMode = MyLocationRenderMode.normal,
  21. Point<num>? logoViewMargins,
  22. CompassViewPosition? compassViewPosition,
  23. Point<num>? compassViewMargins,
  24. AttributionButtonPosition? attributionButtonPosition = AttributionButtonPosition.bottomRight,
  25. Point<num>? attributionButtonMargins,
  26. Duration? iosLongClickDuration,
  27. OnMapClickCallback? onMapClick,
  28. OnUserLocationUpdated? onUserLocationUpdated,
  29. OnMapClickCallback? onMapLongClick,
  30. OnCameraTrackingDismissedCallback? onCameraTrackingDismissed,
  31. OnCameraTrackingChangedCallback? onCameraTrackingChanged,
  32. OnCameraIdleCallback? onCameraIdle,
  33. OnMapIdleCallback? onMapIdle,
  34. List<AnnotationType> annotationOrder = const [AnnotationType.line, AnnotationType.symbol, AnnotationType.circle, AnnotationType.fill],
  35. List<AnnotationType> annotationConsumeTapEvents = const [AnnotationType.symbol, AnnotationType.fill, AnnotationType.line, AnnotationType.circle],
})

Implementation

MapHeroMap({
  super.key,
  required this.initialCameraPosition,
  this.styleString = MapHeroStyles.demo,
  this.token,
  this.onMapCreated,
  this.onStyleLoadedCallback,
  this.gestureRecognizers,
  this.compassEnabled = true,
  this.cameraTargetBounds = CameraTargetBounds.unbounded,
  this.minMaxZoomPreference = MinMaxZoomPreference.unbounded,
  this.rotateGesturesEnabled = true,
  this.scrollGesturesEnabled = true,
  this.zoomGesturesEnabled = true,
  this.tiltGesturesEnabled = true,
  this.doubleClickZoomEnabled,
  this.dragEnabled = true,
  this.trackCameraPosition = false,
  this.myLocationEnabled = false,
  this.myLocationTrackingMode = MyLocationTrackingMode.none,
  this.myLocationRenderMode = MyLocationRenderMode.normal,
  this.logoViewMargins,
  this.compassViewPosition,
  this.compassViewMargins,
  this.attributionButtonPosition = AttributionButtonPosition.bottomRight,
  this.attributionButtonMargins,
  this.iosLongClickDuration,
  this.onMapClick,
  this.onUserLocationUpdated,
  this.onMapLongClick,
  this.onCameraTrackingDismissed,
  this.onCameraTrackingChanged,
  this.onCameraIdle,
  this.onMapIdle,
  this.annotationOrder = const [
    AnnotationType.line,
    AnnotationType.symbol,
    AnnotationType.circle,
    AnnotationType.fill,
  ],
  this.annotationConsumeTapEvents = const [
    AnnotationType.symbol,
    AnnotationType.fill,
    AnnotationType.line,
    AnnotationType.circle,
  ],
})  : assert(
        myLocationRenderMode == MyLocationRenderMode.normal ||
            myLocationEnabled,
        "$myLocationRenderMode requires [myLocationEnabled] set to true.",
      ),
      assert(annotationOrder.length <= 4),
      assert(annotationConsumeTapEvents.length > 0) {
  _globalChannel1.invokeMethod('setHttpHeaders', {
    "headers": {"map-token": token}
  });
}