getCoordinates property

List<LatLng> getCoordinates

Implementation

List<LatLng> get getCoordinates {
  var coordinates = <LatLng>[];
  for (var leg in legs!) {
    for (var step in leg.steps!) {
      if (step.maneuver?.location != null &&
          step.maneuver!.location!.length == 2) {
        coordinates.add(LatLng(step.maneuver!.location!.first.toDouble(),
            step.maneuver!.location!.last.toDouble()));
      }
    }
  }

  return coordinates;
}