BMFPolyline.withMap constructor

BMFPolyline.withMap(
  1. Map map
)

Implementation

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

  super.fromMap(map);

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

  this.indexs = indexs?.map((i) => i as int)?.toList();
  this.width = map['width'];
  list = map['colors'] as List;
  this.colors = list?.map((s) => ColorUtil.hexToColor(s as String))?.toList();
  this.textures = textures?.map((s) => s)?.toList();

  this.dottedLine = map['dottedLine'] as bool;

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

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

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

  this.isThined = map['isThined'] as bool;
  this.clickable = map['clickable'] as bool;
  this.isKeepScale = map['isKeepScale'] as bool;
  this.isFocus = map['isFocus'];
}