toJson method

Map<String, dynamic> toJson()
override

Implementation

Map<String, dynamic> toJson() {
  List<Map<String, dynamic>> waypoints =
      this.waypoints.map((i) => i.toJson()).toList();

  return {
    'type': EnumConvertion.convertToString(type),
    'pointOfInterest': pointOfInterest?.toJson(),
    'maxFlightSpeed': maxFlightSpeed,
    'autoFlightSpeed': autoFlightSpeed,
    'finishedAction': EnumConvertion.convertToString(finishedAction),
    'headingMode': EnumConvertion.convertToString(headingMode),
    'flightPathMode': EnumConvertion.convertToString(flightPathMode),
    'rotateGimbalPitch': rotateGimbalPitch,
    'exitMissionOnRCSignalLost': exitMissionOnRCSignalLost,
    'waypoints': waypoints,
  };
}