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"] = "vector";
  addIfPresent('url', url);
  addIfPresent('tiles', tiles);
  addIfPresent('bounds', bounds);
  addIfPresent('scheme', scheme);
  addIfPresent('minzoom', minzoom);
  addIfPresent('maxzoom', maxzoom);
  addIfPresent('attribution', attribution);
  addIfPresent('promoteId', promoteId);
  return json;
}