toJson method

  1. @override
Object toJson()
override

Converts this object to JSON.

Implementation

@override
Object toJson() {
  final Map<String, Object> json = <String, Object>{};

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

  addIfPresent('tileOverlayId', tileOverlayId.value);
  addIfPresent('fadeIn', fadeIn);
  addIfPresent('transparency', transparency);
  addIfPresent('zIndex', zIndex);
  addIfPresent('visible', visible);
  addIfPresent('tileSize', tileSize);

  return json;
}