project method

  1. @override
Polygon project(
  1. Projection projection
)
override

Returns an object of the same subtype as this with all position data projected using projection and non-positional properties left intact.

If bounds object is available on this, then it's not projected and the returned object has it set null.

Examples:

// just project, the returned object has not bounds populated
someBoundedObject.project(someProjection);

// project and populate, the returned object has bounds populated
someBoundedObject.project(someProjection).populated(onBounds: true);

Implementation

@override
Polygon project(Projection projection) {
  final projected =
      rings.map((ring) => ring.project(projection)).toList(growable: false);

  return Polygon(projected);
}