BMFPolygon.fromMap constructor

BMFPolygon.fromMap(
  1. Map map
)

map => BMFPolygon

Implementation

BMFPolygon.fromMap(Map map)
    : assert(map['coordinates'] != null),
      super.fromMap(map) {
  if (map['coordinates'] != null) {
    coordinates = new List<BMFCoordinate>();
    map['coordinates'].forEach((v) {
      coordinates.add(BMFCoordinate.fromMap(v as Map));
    });
  }

  width = map['width'];
  strokeColor = ColorUtil.hexToColor(map['strokeColor']);
  fillColor = ColorUtil.hexToColor(map['fillColor']);
  lineDashType = BMFLineDashType.values[map['lineDashType'] as int];

  if (map['hollowShapes'] != null) {
    hollowShapes = new List<BMFHollowShape>();
    for (var item in hollowShapes) {
      BMFHollowShape hollowShape = BMFHollowShape.fromMap(item as Map);
      hollowShapes.add(hollowShape);
    }
  }
}