toJson method

Map<String, dynamic> toJson()

Serializes the mappings on this Atlas in a json format.

Implementation

Map<String, dynamic> toJson() {
  final selectionsJson = <String, dynamic>{};
  selections.entries.forEach((entry) {
    selectionsJson[entry.key] = entry.value.toJson();
  });

  final json = <String, dynamic>{}
    ..['id'] = id
    ..['imageData'] = imageData
    ..['selections'] = selectionsJson
    ..['tileWidth'] = tileWidth
    ..['tileHeight'] = tileHeight;

  return json;
}