toJson method

Map<String, dynamic> toJson()

Implementation

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

  return {'type': 'LineString', 'coordinates': pointArr};
}