InteractiveMap<T>.locator constructor
InteractiveMap<T>.locator ({
- Key? key,
- required List<
T> items, - required LatLng positionMapper(
- T item
- required Widget markerBuilder(
- BuildContext context,
- T item,
- int index
- void onStoreTapped(
- T item,
- int index
- void onMapTapped(
- TapPosition,
- LatLng
- InteractiveMapController<
T> ? controller, - double markerWidth = 80.0,
- double markerHeight = 80.0,
- double? focusedZoom = 15.0,
- MapInteractionConfig<
T> ? interaction, - MapThemeConfig? theme,
- MapControlConfig? compassConfig = const MapControlConfig(alignment: Alignment.topRight),
- MapUserLocationConfig? userLocation = const MapUserLocationConfig(followUser: false, requestPermissionAutomatically: false, showUserLocationButton: false, buttonConfig: MapControlConfig(alignment: Alignment.bottomRight)),
- MapControlConfig? zoomConfig,
Factory tailored for Store Locators / Exploration.
Implementation
factory InteractiveMap.locator({
Key? key,
required List<T> items,
required LatLng Function(T item) positionMapper,
required Widget Function(BuildContext context, T item, int index)
markerBuilder,
void Function(T item, int index)? onStoreTapped,
void Function(TapPosition, LatLng)? onMapTapped,
InteractiveMapController<T>? controller,
double markerWidth = 80.0,
double markerHeight = 80.0,
double? focusedZoom = 15.0,
MapInteractionConfig<T>? interaction,
MapThemeConfig? theme,
MapControlConfig? compassConfig = const MapControlConfig(
alignment: Alignment.topRight,
),
MapUserLocationConfig? userLocation = const MapUserLocationConfig(
followUser: false,
requestPermissionAutomatically: false,
showUserLocationButton: false,
buttonConfig: MapControlConfig(alignment: Alignment.bottomRight),
),
MapControlConfig? zoomConfig,
}) {
return InteractiveMap<T>(
key: key,
items: items,
positionMapper: positionMapper,
markerBuilder: markerBuilder,
controller: controller,
markerWidth: markerWidth,
markerHeight: markerHeight,
theme: theme ?? const MapThemeConfig(),
compassConfig: compassConfig,
userLocation: userLocation,
zoomConfig: zoomConfig,
interaction:
interaction ??
MapInteractionConfig<T>(
onTapItem: onStoreTapped,
onMapTap: onMapTapped,
enableRotation: true,
showCompass: true,
focusedZoom: focusedZoom,
),
);
}