VietmapGL constructor

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

Implementation

const VietmapGL({
  super.key,
  this.logoEnabled = true,
  required this.initialCameraPosition,
  this.styleString = VietmapStyles.demo,
  this.onMapCreated,
  this.onMapRenderedCallback,
  this.onMapFirstRenderedCallback,
  this.onStyleLoadedCallback,
  // this.locationEnginePlatforms = LocationEnginePlatforms.defaultPlatform,
  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.isCustomizeUserIcon = true,
  this.annotationOrder = const [
    AnnotationType.line,
    AnnotationType.symbol,
    AnnotationType.circle,
    AnnotationType.polygon,
  ],
  this.annotationConsumeTapEvents = const [
    AnnotationType.symbol,
    AnnotationType.polygon,
    AnnotationType.line,
    AnnotationType.circle,
  ],
})  : assert(
        myLocationRenderMode == MyLocationRenderMode.normal ||
            myLocationEnabled,
        "$myLocationRenderMode requires [myLocationEnabled] set to true.",
      ),
      assert(annotationOrder.length <= 4),
      assert(annotationConsumeTapEvents.length > 0);