AI-generated Key Takeaways
-
GMTSTrafficDatais an object that contains traffic data for a road segment. -
The
routePathproperty provides an array of LatLngs representing the polyline path of the traffic data, which may slightly differ from the actual route path. -
The
speedReadingSpansproperty provides an array ofGMTSSpeedReadingSpanobjects that describe speed information for the polyline path. -
The designated initializer is
-initWithRoutePath:speedReadingSpans:, which takes an array of LatLngs and an array of speed reading spans to initialize the traffic data object. -
The
-initmethod is unavailable, and you should use the-initWithRoutePath:speedReadingSpansmethod instead.
GMTSTrafficData
@interface GMTSTrafficData : GMTCImmutableDataAn 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
GMTSSpeedReadingSpansobjects 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
routePathThe list of LatLngs that make up the route.
speedReadingSpansThe array of
GMTSSpeedReadingSpansobjects for the route. -
Unavailable
Use
-initWithRoutePath:speedReadingSpansinstead.Declaration
Objective-C
- (nonnull instancetype)init;