BMFPolygon.withMap constructor

BMFPolygon.withMap(
  1. Map map
)

Implementation

BMFPolygon.withMap(Map map) {
  if (null == map) {
    return;
  }

  super.fromMap(map);

  List list = map['coordinates'] as List;
  this.coordinates = list
      ?.map((c) => BMFCoordinate.coordinate().fromMap(c) as BMFCoordinate)
      ?.toList();

  this.width = map['width'];
  this.strokeColor = ColorUtil.hexToColor(map['strokeColor']);
  this.fillColor = ColorUtil.hexToColor(map['fillColor']);

  int lineType = map['lineDashType'] as int;
  if (null != lineType &&
      lineType >= 0 &&
      lineType < BMFLineDashType.values.length) {
    this.lineDashType = BMFLineDashType.values[lineType];
  }
}