Anchor constructor

const Anchor({
  1. double x = 0.5,
  2. double y = 0.5,
})

Specifies the anchor to be at a particular point in the marker image.

The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.

The anchor point is specified in the continuous space 0.0, 1.0 x 0.0, 1.0, where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner. The anchoring point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, obtained by scaling the then rounding. For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).

Implementation

const Anchor({this.x = 0.5, this.y = 0.5});