GroundOverlay.fromPosition constructor

GroundOverlay.fromPosition({
  1. required GroundOverlayId groundOverlayId,
  2. required MapBitmap image,
  3. required LatLng position,
  4. double? width,
  5. double? height,
  6. Offset anchor = const Offset(0.5, 0.5),
  7. double bearing = 0.0,
  8. double transparency = 0.0,
  9. int zIndex = 0,
  10. bool visible = true,
  11. bool clickable = true,
  12. VoidCallback? onTap,
  13. 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,
  );
}