GenericMap constructor

GenericMap({
  1. Key? key,
  2. PlatformMapProviderSettings platformMapProviderSettings = const PlatformMapProviderSettings(defaultProvider: MapProviderEnum.googleMaps),
  3. Place initialLocation = const Place(LatLng(37.7858, -122.4064), 'San Francisco, CA', 'San Francisco'),
  4. double initialZoom = 14,
  5. MapViewMode mode = MapViewMode.static,
  6. dynamic onControllerReady(
    1. MapViewController
    )?,
  7. List<PolyLineLayer> polylines = const [],
  8. MapMovedCallback? onMapMoved,
  9. bool interactive = false,
  10. EdgeInsets padding = EdgeInsets.zero,
  11. EdgeInsets actionsPadding = EdgeInsets.zero,
  12. List<CustomMarker> markers = const <CustomMarker>[],
  13. CenterMarker centerMarkerBuilder(
    1. BuildContext context,
    2. GlobalKey<State<StatefulWidget>> key,
    3. String? address
    )?,
  14. AddressResolver? addressResolver,
  15. List<CircleMarker> circleMarkers = const [],
  16. bool isPolylineDrawEnabled = false,
  17. List<LatLng> initialDrawingPoints = const [],
  18. dynamic onPolylineDrawn(
    1. List<LatLng>
    )?,
  19. dynamic onPolylineEdited(
    1. String polylineId,
    2. List<LatLng> points
    )?,
  20. bool enableAddressResolve = false,
  21. GoogleMapsOptions? googleMapOptions,
  22. List<HeatmapConfig> heatmapConfig = const [],
  23. bool showMyLocation = true,
  24. Duration addressResolveDebounce = const Duration(milliseconds: 300),
  25. Duration? mapMoveDebounce,
})

Implementation

GenericMap({
  super.key,
  this.platformMapProviderSettings = const PlatformMapProviderSettings(
      defaultProvider: MapProviderEnum.googleMaps),
  this.initialLocation = const Place(
    LatLng(37.7858, -122.4064),
    'San Francisco, CA',
    'San Francisco',
  ),
  this.initialZoom = 14,
  this.mode = MapViewMode.static,
  this.onControllerReady,
  this.polylines = const [],
  this.onMapMoved,
  this.interactive = false,
  this.padding = EdgeInsets.zero,
  this.actionsPadding = EdgeInsets.zero,
  this.markers = const <CustomMarker>[],
  this.centerMarkerBuilder,
  this.addressResolver,
  this.circleMarkers = const [],
  this.isPolylineDrawEnabled = false,
  this.initialDrawingPoints = const [],
  this.onPolylineDrawn,
  this.onPolylineEdited,
  this.enableAddressResolve = false,
  this.googleMapOptions,
  this.heatmapConfig = const [],
  this.showMyLocation = true,
  this.addressResolveDebounce = const Duration(milliseconds: 300),
  this.mapMoveDebounce,
}) {
  assert(
    mode == MapViewMode.picker && centerMarkerBuilder != null ||
        mode == MapViewMode.static,
    'centerMarkerBuilder must be provided when mode is MapViewMode.picker',
  );
  assert(
    mode == MapViewMode.picker && addressResolver != null ||
        mode == MapViewMode.static,
    'addressResolver must be provided when mode is MapViewMode.picker',
  );
  assert(
    mode == MapViewMode.picker && interactive || mode == MapViewMode.static,
    'interactive must be true when mode is MapViewMode.picker',
  );
}