toJson method

Map<String, dynamic> toJson()

Converts this circle to a JSON object for serialization.

This is used to pass circle data to the HTML map view.

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'center': {'lat': center.latitude, 'lng': center.longitude},
    'radius': radius,
    'fillColor': _colorToString(fillColor) ?? '#0080ff',
    'fillOpacity': fillOpacity,
    'strokeColor': _colorToString(strokeColor) ?? '#000000',
    'strokeWidth': strokeWidth,
    'strokeOpacity': strokeOpacity,
  };
}