OsrmRouteLeg.fromMap constructor

OsrmRouteLeg.fromMap(
  1. Map<String, dynamic> json
)

fromMap method to get the OsrmRouteLeg from a json map

Implementation

factory OsrmRouteLeg.fromMap(Map<String, dynamic> json) {
  return OsrmRouteLeg(
    distance: json['distance'],
    duration: json['duration'],
    weight: json['weight'],
    summary: json['summary'].toString(),
    steps: (json['steps'] as List).map((e) {
      return OsrmRouteStep.fromMap(e);
    }).toList(),
  );
}