boundsAligned2D method

  1. @override
Position? boundsAligned2D({
  1. Aligned align = Aligned.center,
  2. PositionScheme scheme = Position.scheme,
})
override

Returns an aligned 2D position relative to a bounding box accessed by getBounds.

By default a returned aligned position is a center point, but this can be customized using align.

Returns null if getBounds returns null.

Use scheme to set the position scheme:

  • Position.scheme for generic position data (geographic, projected or any other), this is also the default
  • Projected.scheme for projected position data
  • Geographic.scheme for geographic position data

Implementation

@override
Position? boundsAligned2D({
  Aligned align = Aligned.center,
  PositionScheme scheme = Position.scheme,
}) =>
    scheme.position.call(
      x: position.x,
      y: position.y,
    );