toJson method

  1. @override
Map<String, dynamic> toJson()
override

Converts the MPRoute to a JSON representation that can be parsed by the MapsIndoors Platform SDK

Implementation

@override
Map<String, dynamic> toJson() {
  var jsonLegs = legs?.map((e) => e.toJson()).toList();
  return {
    "legs": jsonLegs,
    "copyrights": copyrights,
    "summary": summary,
    "warnings": warnings,
    "restrictions": restrictions,
    "bounds": bounds?.toJson()
  };
}