toDrawable method

  1. @override
PolygonLayerOptions toDrawable({
  1. Color? fillColor,
  2. Color borderColor = const Color(0x00000000),
  3. double borderStrokeWidth = 3.0,
  4. bool isDotted = false,
  5. String? label,
  6. TextStyle labelStyle = const TextStyle(),
  7. PolygonLabelPlacement labelPlacement = PolygonLabelPlacement.polylabel,
})
override

Create a drawable area for a FlutterMap out of this region

Returns a PolygonLayerOptions to be added to the layer property of a FlutterMap.

Implementation

@override
PolygonLayerOptions toDrawable({
  Color? fillColor,
  Color borderColor = const Color(0x00000000),
  double borderStrokeWidth = 3.0,
  bool isDotted = false,
  String? label,
  TextStyle labelStyle = const TextStyle(),
  PolygonLabelPlacement labelPlacement = PolygonLabelPlacement.polylabel,
}) =>
    PolygonLayerOptions(
      polygons: [
        Polygon(
          isFilled: fillColor != null,
          color: fillColor ?? Colors.transparent,
          borderColor: borderColor,
          borderStrokeWidth: borderStrokeWidth,
          isDotted: isDotted,
          label: label,
          labelStyle: labelStyle,
          labelPlacement: labelPlacement,
          points: toList(),
        )
      ],
    );