Map<String, dynamic> toJson() => { 'name': name, 'points': points.map((p) => {'lat': p.latitude, 'lng': p.longitude}).toList(), };