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'];
  this.colors =
      colors?.map((s) => ColorUtil.hexToColor(s as String))?.toList();
  this.textures = textures?.map((s) => s)?.toList();
  this.lineDashType = BMFLineDashType.values[map['lineDashType'] as int];
  this.lineCapType = BMFLineCapType.values[map['lineCapType'] as int];
  this.lineJoinType = BMFLineJoinType.values[map['lineJoinType'] as int];
  this.clickable = map['clickable'];
  this.isKeepScale = map['isKeepScale'];
  this.isFocus = map['isFocus'];
}