AI-generated Key Takeaways
-
GMTSTrafficData
is an object that contains traffic data for a road segment. -
The
routePath
property provides an array of LatLngs representing the polyline path of the traffic data, which may slightly differ from the actual route path. -
The
speedReadingSpans
property provides an array ofGMTSSpeedReadingSpan
objects 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
-init
method is unavailable, and you should use the-initWithRoutePath:speedReadingSpans
method instead.
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;