GroundOverlay.fromBounds constructor

GroundOverlay.fromBounds({
  1. required GroundOverlayId groundOverlayId,
  2. required MapBitmap image,
  3. required LatLngBounds bounds,
  4. Offset anchor = const Offset(0.5, 0.5),
  5. double bearing = 0.0,
  6. double transparency = 0.0,
  7. int zIndex = 0,
  8. bool visible = true,
  9. bool clickable = true,
  10. VoidCallback? onTap,
})

Creates a GroundOverlay fitted to the specified bounds with the provided image.

Example:

GroundOverlay.fromBounds(
  groundOverlayId: const GroundOverlayId('overlay_id'),
  image: await AssetMapBitmap.create(
    createLocalImageConfiguration(context),
    'assets/images/ground_overlay.png',
    bitmapScaling: MapBitmapScaling.none,
  ),
  bounds: LatLngBounds(
    southwest: LatLng(37.42, -122.08),
    northeast: LatLng(37.43, -122.09),
  ),
);

Implementation

factory GroundOverlay.fromBounds({
  required GroundOverlayId groundOverlayId,
  required MapBitmap image,
  required LatLngBounds bounds,
  Offset anchor = const Offset(0.5, 0.5),
  double bearing = 0.0,
  double transparency = 0.0,
  int zIndex = 0,
  bool visible = true,
  bool clickable = true,
  VoidCallback? onTap,
}) {
  return GroundOverlay._(
    groundOverlayId: groundOverlayId,
    image: image,
    bounds: bounds,
    anchor: anchor,
    bearing: bearing,
    transparency: transparency,
    zIndex: zIndex,
    visible: visible,
    clickable: clickable,
    onTap: onTap,
  );
}