toMap method

Map<String, dynamic> toMap({
  1. bool withId = true,
})

name the name of the GeoSerie typeStr the type of the serie: group, line or polygon id the id of the serie Get a json map from this GeoSerie

Implementation

/// Get a json map from this [GeoSerie]
Map<String, dynamic> toMap({bool withId = true}) {
  /// [withId] include the id in the result
  final json = <String, dynamic>{
    "name": name,
    "type": "${_typeToString(type)}",
    "surface": surface
  };
  if (withId) {
    json["id"] = id;
  }
  return json;
}