getShapes method

Future<Map<String, BusShape>> getShapes ()

Returns a List of BusShape objects.

Implementation

Future<Map<String, BusShape>> getShapes() async {
  var response = await fetch('busShapes',
      query: {'query': '{"route_id": ["87-184","286-184","289-184"]}'});

  Map<String, BusShape> shapesMap = response != null
      ? Map.fromIterable(json.decode(response.body),
          key: (json) => json['properties']['route_id'],
          value: (json) => BusShape.fromJson(json))
      : {};
  return shapesMap;
}