MapBitmap class abstract

Represents a BitmapDescriptor base class for map bitmaps.

See AssetMapBitmap and BytesMapBitmap for concrete implementations.

The imagePixelRatio should be set to the correct pixel ratio of bitmap image. If the width or height is provided, the imagePixelRatio value is ignored.

bitmapScaling controls the scaling behavior:

  • MapBitmapScaling.auto automatically upscales and downscales the image to match the device's pixel ratio or the specified dimensions, maintaining consistency across devices.
  • MapBitmapScaling.none disables automatic scaling, which is useful when performance is a concern or if the asset is already scaled appropriately.

Optionally, width and height can be specified to control the dimensions of the rendered image:

  • If both width and height are non-null, the image will have the specified dimensions, which might distort the original aspect ratio, similar to BoxFit.fill.
  • If only one of width and height is non-null, then the output image will be scaled to the associated width or height, and the other dimension will take whatever value is needed to maintain the image's original aspect ratio. These cases are similar to BoxFit.fitWidth and BoxFit.fitHeight, respectively.
Inheritance

Properties

bitmapScaling MapBitmapScaling
The scaling method of the bitmap.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The target height of the bitmap in logical pixels.
final
imagePixelRatio double
The pixel ratio of the bitmap.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double?
The target width of the bitmap in logical pixels.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object
Convert the object to a Json format.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited