GenericMap constructor

GenericMap({
  1. Key? key,
  2. PlatformMapProviderSettings platformMapProviderSettings = const PlatformMapProviderSettings(defaultProvider: MapProviderEnum.openStreetMaps),
  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. dynamic onMapMoved(
    1. MapMovedEvent
    )?,
  9. bool useCachedTiles = false,
  10. bool interactive = false,
  11. EdgeInsets padding = EdgeInsets.zero,
  12. EdgeInsets actionsPadding = EdgeInsets.zero,
  13. List<CustomMarker> markers = const <CustomMarker>[],
  14. CenterMarker centerMarkerBuilder(
    1. BuildContext context,
    2. GlobalKey<State<StatefulWidget>> key,
    3. String? address
    )?,
  15. AddressResolver? addressResolver,
  16. List<CircleMarker> circleMarkers = const [],
  17. bool isPolylineDrawEnabled = false,
  18. PolyEditor? polyEditor,
  19. dynamic onPolylineDrawn(
    1. List<LatLng>
    )?,
  20. MapboxSdkOptions? mapboxSdkOptions,
  21. MapboxOptions? mapboxOptions,
  22. MapLibreOptions? mapLibreOptions,
  23. bool enableAddressResolve = false,
  24. OpenStreetMapsOptions? openStreetMapOptions,
  25. GoogleMapsOptions? googleMapOptions,
  26. List<HeatmapConfig> heatmapConfig = const [],
  27. bool showMyLocation = true,
  28. Duration addressResolveDebounce = const Duration(milliseconds: 300),
  29. Duration? mapMoveDebounce,
})

Implementation

GenericMap({
  super.key,
  this.platformMapProviderSettings = const PlatformMapProviderSettings(
      defaultProvider: MapProviderEnum.openStreetMaps),
  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.useCachedTiles = false,
  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.polyEditor,
  this.onPolylineDrawn,
  this.mapboxSdkOptions,
  this.mapboxOptions,
  this.mapLibreOptions,
  this.enableAddressResolve = false,
  this.openStreetMapOptions,
  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',
  );
}