fetchBusPositionsForLocation function

Future<List<BusPosition>> fetchBusPositionsForLocation(
  1. String apiKey, {
  2. required double latitude,
  3. required double longitude,
  4. required double radiusMeters,
})

Fetches bus positions for a specific location.

apiKey is your API key for the WMATA API.

latitude is the last reported Latitude of the bus.

longitude is the last reported Longitude of the bus.

radiusMeters is the radius, in meters, to include in the search area.

Implementation

Future<List<BusPosition>> fetchBusPositionsForLocation(
  String apiKey, {
  required double latitude,
  required double longitude,
  required double radiusMeters,
}) async =>
    await BusPositionService.fetchBusPositions(
      apiKey,
      lat: latitude,
      lon: longitude,
      radius: radiusMeters,
    );