BMFDistrictSearchResult.fromMap constructor

BMFDistrictSearchResult.fromMap(
  1. Map map
)

map => BMFDistrictSearchResult

Implementation

BMFDistrictSearchResult.fromMap(Map map)
    : assert(map != null,
          'Construct a BMFDistrictSearchResult,The parameter map cannot be null !') {
  code = map['code'];
  name = map['name'];
  center =
      map['center'] == null ? null : BMFCoordinate.fromMap(map['center']);

  if (map['paths'] != null) {
    paths = new List<List<BMFCoordinate>>();
    for (List item in map['paths'] as List) {
      List<BMFCoordinate> list = new List<BMFCoordinate>();
      for (var ite in item) {
        BMFCoordinate coordinate = BMFCoordinate.fromMap(ite as Map);
        list.add(coordinate);
      }
      paths.add(list);
    }
  }
}