toJson method

Map<String, dynamic> toJson()
override

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> json = <String, dynamic>{};

  void addIfPresent(String fieldName, dynamic value) {
    if (value != null) {
      json[fieldName] = value;
    }
  }

  json["type"] = "geojson";
  addIfPresent('data', data);
  addIfPresent('maxzoom', maxzoom);
  addIfPresent('attribution', attribution);
  addIfPresent('buffer', buffer);
  addIfPresent('tolerance', tolerance);
  addIfPresent('cluster', cluster);
  addIfPresent('clusterRadius', clusterRadius);
  addIfPresent('clusterMaxZoom', clusterMaxZoom);
  addIfPresent('clusterProperties', clusterProperties);
  addIfPresent('lineMetrics', lineMetrics);
  addIfPresent('generateId', generateId);
  addIfPresent('promoteId', promoteId);
  return json;
}