Polygon class Null safety

A Polygon is a single closed path with shared properties. The first LinearRing defines the outer boundary of the Polygon, while the following LinearRings define holes within the Polygon.

Inheritance

Constructors

Polygon(List<LinearRing> coordinates, {dynamic properties = const <String, dynamic>{}})
Polygon.fromJson(Map<String, dynamic> json)
Creates a Polygon from a GeoJSON Map.
factory
Polygon.fromWKT(String wkt)
Creates a Polygon from a WKT String. Right now, cannot handle polygons with holes.
factory

Properties

area double
The area pf the Polygon in square meters.
read-only
coordinates List<LinearRing>
read / write
hashCode int
The hash code for this object.
read-only, inherited
properties Map<String, dynamic>
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

explode() List<Point>
Explodes the Polygon into a List of Points.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Returns a GeoJSON Map of the Polygon.
override
toLineString() LineString
Uses the Polygon's coordinates to make a LineString. Ignores any holes in the polygon.
toString() String
A string representation of this object.
override
toWKT() String
Converts the Polygon to a WKT String.
override

Operators

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

Static Properties

type String
final