toJson method

Map<String, dynamic> toJson()

Converts the GeoJsonFeatureProperties to a Map with keys 'groupIndex', 'value' and 'center'.

The center is converted to a List with 2 elements.

Implementation

Map<String, dynamic> toJson() => {
      'group_index': groupIndex,
      'value': value,
      'center': center == null
          ? null
          : <double>[center!.longitude, center!.latitude],
      'osm_id': osmId,
      'osm_type': osmType,
      'distance': distance,
      'category_ids': categoryIds,
      'osm_tags': osmTags,
    }..removeWhere((key, value) => value == null);