OsrmWaypoint.fromMap constructor

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

fromMap method to get the OsrmWaypoint from a json map

Implementation

factory OsrmWaypoint.fromMap(Map<String, dynamic> json) {
  return OsrmWaypoint(
    name: json['name'],
    location: json['location'] != null
        ? (json['location'][0], json['location'][1])
        : null,
    distance: json['distance'],
    hint: json['hint'],
    nodes: json['nodes'] != null
        ? (json['nodes'] as List).map((e) => e as num).toList()
        : null,
    alternativesCount: json['alternatives_count'],
    matchingsIndex: json['matchings_index'],
    waypointIndex: json['waypoint_index'],
  );
}