toPolygon<T extends Object> method
- PolygonProperties<
T> ? polygonProps,
Converts a list coords of a Polygon into a Polygon
Implementation
Polygon<T> toPolygon<T extends Object>({PolygonProperties<T>? polygonProps}) {
PolygonProperties<T> polygonProperties =
polygonProps ?? PolygonProperties<T>();
List<List<LatLng>> holes = sublist(
1,
).map((List<List<double>> f) => f.toLatLng()).toList();
Polygon<T> polygon = Polygon<T>(
points: first.toLatLng(),
holePointsList: holes,
color: polygonProperties.fillColor,
hitValue: polygonProperties.hintValue,
borderColor: polygonProperties.borderColor,
borderStrokeWidth: polygonProperties.borderStokeWidth,
disableHolesBorder: polygonProperties.disableHolesBorder,
label: polygonProperties.label,
pattern: polygonProperties.pattern,
labelPlacementCalculator: polygonProperties.labelPlacementCalculator,
labelStyle: polygonProperties.labelStyle,
rotateLabel: polygonProperties.rotateLabel,
strokeCap: polygonProperties.strokeCap,
strokeJoin: polygonProperties.strokeJoin,
);
// consoleLog(polygon.area(), color: 35);
return polygon;
}