Map<String, dynamic> toJson() { var pointArr = []; points.forEach((point) { pointArr.add(point.toJson()['coordinates']); }); return {'type': 'LineString', 'coordinates': pointArr}; }