Feature<T extends GeometryObject>.fromJson constructor

Feature<T extends GeometryObject>.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Feature.fromJson(Map<String, dynamic> json) => Feature(
      id: json['id'],
      geometry: json['geometry'] == null
          ? null
          : GeometryObject.deserialize(json['geometry']) as T,
      properties: json['properties'],
      bbox: json['bbox'] == null
          ? null
          : BBox.fromJson(
              (json['bbox'] as List).map((e) => e as num).toList()),
      fields: Map.fromEntries(
        json.entries.where(
          (el) =>
              el.key != 'geometry' &&
              el.key != 'properties' &&
              el.key != 'id',
        ),
      ),
    );