toJson method
Converts the GeoJsonFeatureCollection to a Map with keys 'type', 'bbox' and 'features'.
The 'bbox' key is converted to list of 4 doubles implying 2 coordinates.
Implementation
Map<String, dynamic> toJson() => {
'type': 'FeatureCollection',
'bbox': [
bbox[0].longitude,
bbox[0].latitude,
bbox[1].longitude,
bbox[1].latitude,
],
'features': features
.map<Map<String, dynamic>>((feature) => feature.toJson())
.toList(),
};