GroundOverlay.fromPosition constructor
GroundOverlay.fromPosition({
- required GroundOverlayId groundOverlayId,
- required MapBitmap image,
- required LatLng position,
- double? width,
- double? height,
- 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,
- double? zoomLevel,
Creates a GroundOverlay to given position
with the given image
.
Example:
GroundOverlay.fromPosition(
groundOverlayId: const GroundOverlayId('overlay_id'),
image: await AssetMapBitmap.create(
createLocalImageConfiguration(context),
'assets/images/ground_overlay.png',
bitmapScaling: MapBitmapScaling.none,
),
position: LatLng(37.42, -122.08),
width: 100,
height: 100,
zoomLevel: 14,
);
Implementation
factory GroundOverlay.fromPosition({
required GroundOverlayId groundOverlayId,
required MapBitmap image,
required LatLng position,
double? width,
double? height,
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,
double? zoomLevel,
}) {
return GroundOverlay._(
groundOverlayId: groundOverlayId,
image: image,
position: position,
width: width,
height: height,
anchor: anchor,
bearing: bearing,
transparency: transparency,
zIndex: zIndex,
visible: visible,
clickable: clickable,
onTap: onTap,
zoomLevel: zoomLevel,
);
}