toJson abstract method

Map<String, dynamic> toJson()

Serializes this annotation to JSON.

Implement this to define how your custom annotation is persisted. Include all properties needed to recreate the annotation.

The JSON should include at minimum:

  • 'id': The annotation's unique identifier
  • 'type': The annotation type string
  • 'x', 'y': Position coordinates
  • Any custom properties specific to your annotation

Implementation

Map<String, dynamic> toJson();