# GoogleRidesharingConsumer Framework Reference

# GMTSTrafficData

    @interface GMTSTrafficData : https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCImmutableData.html

An object that holds the traffic data for a stretch of road.
- `


  ### [routePath](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrafficData#/c:objc(cs)GMTSTrafficData(py)routePath)


  ` The array of LatLngs that make the polyline representing the path for a stretch of data. Note
  that this path may vary subtly from the path for the route. For example, there might be
  additional points needed where speed types change.

  #### Declaration

  Swift

      var routePath: [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html] { get }

  Objective-C

      @property (nonatomic, readonly) NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html *> *_Nonnull routePath;

- `


  ### [speedReadingSpans](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrafficData#/c:objc(cs)GMTSTrafficData(py)speedReadingSpans)


  ` The array of `GMTSSpeedReadingSpans` objects for a segment of the polyline path.

  #### Declaration

  Swift

      var speedReadingSpans: [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSSpeedReadingSpan.html] { get }

  Objective-C

      @property (nonatomic, readonly) NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSSpeedReadingSpan.html *> *_Nonnull speedReadingSpans;

- `


  ### [-initWithRoutePath:speedReadingSpans:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrafficData#/c:objc(cs)GMTSTrafficData(im)initWithRoutePath:speedReadingSpans:)


  ` Initializes the object by passing the traffic data attributes.

  #### Declaration

  Swift

      init(routePath: [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html], speedReadingSpans: [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSSpeedReadingSpan.html])

  Objective-C

      - (nonnull instancetype)
          initWithRoutePath:(nonnull NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html *> *)routePath
          speedReadingSpans:
              (nonnull NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSSpeedReadingSpan.html *> *)speedReadingSpans;

  #### Parameters

  |---|---|
  | ` routePath ` | The list of LatLngs that make up the route. |
  | ` speedReadingSpans ` | The array of `GMTSSpeedReadingSpans` objects for the route. |

- `


  ### [-init](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSTrafficData#/c:objc(cs)GMTSTrafficData(im)init)


  ` Unavailable
  Use `-initWithRoutePath:speedReadingSpans` instead.

  #### Declaration

  Objective-C

      - (nonnull instancetype)init;