toMap method
Implementation
Map<String, dynamic> toMap() {
return <String, dynamic>{
'tileSize': tileSize,
'mapWidth': mapWidth,
'mapHeight': mapHeight,
'imgPath': imgPath,
'layers': layers.map((x) => x.toMap()).toList(),
};
}