toOptionsJSON method

  1. @override
void toOptionsJSON(
  1. StringBuffer buffer
)
override

Implementation

@override
void toOptionsJSON(StringBuffer buffer) {
  super.toOptionsJSON(buffer);

  if (borderPath != null) {
    buffer.writeAll(['"borderPath":', jsonEncode(borderPath), ','], '');
  }
  if (field != null) {
    buffer.writeAll(['"field":', jsonEncode(field), ','], '');
  }
  if (geoBounds != null) {
    buffer.writeAll(['"geoBounds":', jsonEncode(geoBounds), ','], '');
  }
  if (id != null) {
    buffer.writeAll(['"id":', jsonEncode(id), ','], '');
  }
  if (projection != null) {
    buffer.writeAll(['"projection":', projection?.toJSON(), ','], '');
  }
  if (borderColor != null) {
    buffer.writeAll(['"borderColor":', jsonEncode(borderColor), ','], '');
  }
  if (borderWidth != null) {
    buffer.writeAll(['"borderWidth":', borderWidth, ','], '');
  }
  if (padding != null) {
    buffer.write('"padding":[');
    for (var item in padding!) {
      buffer.writeAll([jsonEncode(item), ','], '');
    }
    buffer.write('],');
  }
  if (relativeTo != null) {
    buffer.writeAll(['"relativeTo":', jsonEncode(relativeTo), ','], '');
  }
  if (units != null) {
    buffer.writeAll(['"units":', jsonEncode(units), ','], '');
  }
}