toJson method Null safety

Map<String, dynamic> toJson()

Converts the FeatureCollection to a GEOJSON FeatureCollection object.

Implementation

Map<String, dynamic> toJson() {
  return {
    'type': 'FeatureCollection',
    'features': features.map((f) => f.toJson()).toList(),
  };
}