setPolygon abstract method

bool setPolygon(
  1. LocationPolygon polygon
)

Method is used to specify the source polygon of the object. polygon Metrics coordinates of the polygon LocationPolygon. Returns true if success, false otherwise.

Example:

// Set polygon geometry
List<Point> points = [
 Point(100.0, 200.0),
 Point(150.0, 250.0),
 Point(200.0, 200.0),
 Point(150.0, 150.0),
];
Polygon metricPolygon = Polygon(points);
LocationPolygon polygon = LocationPolygon(metricPolygon, 1, 0);
bool success = _polygonMapObject!.setPolygon(polygon);
print("Set polygon with ${points.length} points: $success");

Implementation

bool setPolygon(LocationPolygon polygon);