PolygonLabelPlacementCalculator class abstract interface

Calculates the position of a Polygon.label within its Polygon in geographic (lat/lng) space

Important

If the polygon may be over the anti-meridan boundary, PolygonLabelPlacementCalculator.simpleMultiWorldCentroid must be used - other calculators will produce unexpected results.


Implementers: if the constructor is zero-argument, and there is no equality implementation, constructors should always be invoked with the const keyword, which may be enforced with the literal annotation.

Annotations

Constructors

PolygonLabelPlacementCalculator.centroid()
Places the Polygon.label at the centroid calculated using the signed area formula
const
factory
PolygonLabelPlacementCalculator.polylabel({double precision})
Places the Polygon.label at the point furthest away from the outline, calculated using a Dart implementation of Mapbox's 'polylabel' algorithm
const
factory
PolygonLabelPlacementCalculator.simpleCentroid()
Places the Polygon.label at the approximate centroid calculated by averaging all the points of the polygon
const
factory
PolygonLabelPlacementCalculator.simpleMultiWorldCentroid()
Similar to PolygonLabelPlacementCalculator.simpleCentroid, but supports correct placement of the Polygon.label when the polygon lies across the anti-meridian
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(Polygon<Object> polygon) LatLng
Given a polygon (and its points), calculate a single position at which the center of the label should be placed
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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