GoogleRidesharingConsumer Framework Reference

GMTSTrafficData

@interface GMTSTrafficData : GMTCImmutableData

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

  • 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: [GMTSLatLng] { get }

    Objective-C

    @property (nonatomic, readonly) NSArray<GMTSLatLng *> *_Nonnull routePath;
  • The array of GMTSSpeedReadingSpans objects for a segment of the polyline path.

    Declaration

    Swift

    var speedReadingSpans: [GMTSSpeedReadingSpan] { get }

    Objective-C

    @property (nonatomic, readonly) NSArray<GMTSSpeedReadingSpan *> *_Nonnull speedReadingSpans;
  • Initializes the object by passing the traffic data attributes.

    Declaration

    Swift

    init(routePath: [GMTSLatLng], speedReadingSpans: [GMTSSpeedReadingSpan])

    Objective-C

    - (nonnull instancetype)
        initWithRoutePath:(nonnull NSArray<GMTSLatLng *> *)routePath
        speedReadingSpans:
            (nonnull NSArray<GMTSSpeedReadingSpan *> *)speedReadingSpans;

    Parameters

    routePath

    The list of LatLngs that make up the route.

    speedReadingSpans

    The array of GMTSSpeedReadingSpans objects for the route.

  • Unavailable

    Use -initWithRoutePath:speedReadingSpans instead.

    Declaration

    Objective-C

    - (nonnull instancetype)init;