toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  final Map<String, dynamic> updateMap = <String, dynamic>{};

  void addIfNonNull(String fieldName, dynamic value) {
    if (value != null) {
      updateMap[fieldName] = value;
    }
  }

  addIfNonNull('markersToAdd', serializeOverlaySet(markersToAdd!));
  addIfNonNull('markersToChange', serializeOverlaySet(markersToChange!));
  addIfNonNull('markerIdsToRemove', markerIdsToRemove?.toList());

  return updateMap;
}