GenericMap constructor
GenericMap({
- Key? key,
- PlatformMapProviderSettings platformMapProviderSettings = const PlatformMapProviderSettings(defaultProvider: MapProviderEnum.openStreetMaps),
- Place initialLocation = const Place(LatLng(37.7858, -122.4064), 'San Francisco, CA', 'San Francisco'),
- double initialZoom = 14,
- MapViewMode mode = MapViewMode.static,
- dynamic onControllerReady()?,
- List<
PolyLineLayer> polylines = const [], - dynamic onMapMoved()?,
- bool useCachedTiles = false,
- bool interactive = false,
- EdgeInsets padding = EdgeInsets.zero,
- EdgeInsets actionsPadding = EdgeInsets.zero,
- List<
CustomMarker> markers = const <CustomMarker>[], - CenterMarker centerMarkerBuilder(
- BuildContext context,
- GlobalKey<
State< key,StatefulWidget> > - String? address
- AddressResolver? addressResolver,
- List<
CircleMarker> circleMarkers = const [], - bool isPolylineDrawEnabled = false,
- PolyEditor? polyEditor,
- dynamic onPolylineDrawn(
- List<
LatLng>
- List<
- MapboxSdkOptions? mapboxSdkOptions,
- MapboxOptions? mapboxOptions,
- MapLibreOptions? mapLibreOptions,
- bool enableAddressResolve = false,
- OpenStreetMapsOptions? openStreetMapOptions,
- GoogleMapsOptions? googleMapOptions,
- List<
HeatmapConfig> heatmapConfig = const [], - bool showMyLocation = true,
- Duration addressResolveDebounce = const Duration(milliseconds: 300),
- 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',
);
}