GeoPolygon class
Represents a polygonal geofence area.
A GeoPolygon is defined by a list of GeoPoint vertices connected in order to form a closed shape.
Example:
final polygon = GeoPolygon(points: [
GeoPoint(latitude: 37.7749, longitude: -122.4194),
GeoPoint(latitude: 37.7849, longitude: -122.4094),
GeoPoint(latitude: 37.7649, longitude: -122.4094),
]);
Constructors
-
GeoPolygon({required List<
GeoPoint> points}) -
Creates a new GeoPolygon with the given
points.const -
GeoPolygon.fromMaps(List<
Map< maps)String, double> > -
Creates a GeoPolygon from a list of coordinate maps.
factory
- GeoPolygon.rectangle({required double north, required double south, required double east, required double west})
-
Creates a rectangular polygon from bounding coordinates.
factory
Properties
- centroid → GeoPoint
-
Returns the centroid (geometric center) of this polygon.
no setter
- hashCode → int
-
Returns a hash code for this GeoPolygon.
no setteroverride
- isConvex → bool
-
Checks if this polygon is convex.
no setter
-
points
→ List<
GeoPoint> -
The list of vertices defining the polygon.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- vertexCount → int
-
Returns the number of vertices in this polygon.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMaps(
) → List< Map< String, double> > - Converts this GeoPolygon to a list of maps.
-
toString(
) → String -
Returns a string representation of this polygon.
override
Operators
-
operator ==(
Object other) → bool -
Compares this GeoPolygon with
otherfor equality.override