GroundOverlay.fromBounds constructor
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,
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,
);
}