toJson method

Map<String, dynamic> toJson()

Converts this marker to a JSON object for serialization.

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

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'lat': position.latitude,
    'lng': position.longitude,
    if (color != null) 'color': toColorString(),
    'draggable': draggable,
    if (title != null) 'title': title,
  };
}