parseGeoJson function
Parses a GeoJSON object from a map.
Implementation
dynamic parseGeoJson(Map<String, dynamic> json) {
final type = json['type'] as String?;
switch (type) {
case 'FeatureCollection':
return GeoJsonFeatureCollection.fromJson(json);
case 'Feature':
return GeoJsonFeature.fromJson(json);
default:
return GeoJsonGeometry.fromJson(json);
}
}