Map<String, dynamic> toJson() { return { 'name': name, 'order': order, if (subLayers != null) 'subLayers': subLayers!.map((e) => e.toJson()).toList(), }; }