TrafficContext
Objective-C
@interface TrafficContext : NSObject
Swift
class TrafficContext : NSObject
This class handles the traffic information.
-
The delegate for the persistent roadblock.
Declaration
Objective-C
@property (nonatomic, weak) NSObject<PersistentRoadblockDelegate> *_Nullable persistentRoadblockDelegate;
Swift
weak var persistentRoadblockDelegate: (any PersistentRoadblockDelegate)? { get set }
-
Get the online traffic service restrictions for the given position.
Declaration
Objective-C
- (TrafficOnlineRestrictions)getOnlineServiceRestrictions: (nonnull CoordinatesObject *)location;
Swift
func getOnlineServiceRestrictions(_ location: CoordinatesObject) -> TrafficOnlineRestrictions
Parameters
location
The check location.
Return Value
Traffic restriction type.
-
Get data transfer statistics for this service.
Declaration
Objective-C
- (nonnull TransferStatisticsContext *)getTransferStatistics;
Swift
func getTransferStatistics() -> TransferStatisticsContext
-
Add an user persistent roadblock to collection ( path impact zone type ).
Declaration
Objective-C
- (nullable TrafficEventObject *) addPersistentRoadblock:(nonnull NSArray<CoordinatesObject *> *)coordinates startTime:(nonnull TimeObject *)startUTC expireTime:(nonnull TimeObject *)expireUTC transportMode:(RouteTransportMode)transportMode;
Swift
func addPersistentRoadblock(_ coordinates: [CoordinatesObject], startTime startUTC: TimeObject, expireTime expireUTC: TimeObject, transportMode: RouteTransportMode) -> TrafficEventObject?
Parameters
coordinates
The roadblock coordinates list.
startUTC
The roadblock start time in Coordinated Universal Time.
expireUTC
The roadblock expire time in Coordinated Universal Time.
transportMode
The transport mode for which the roadblock applies. @details if coordsStart == coordsEnd a point located roadblock is defined - this may result in 2 map roadblocks for both ways. @details if coordsStart != coordsEnd a path located roadblock is defined - this will result in 1 map roadblock in start -> end way.
Return Value
The new defined roadblock. On success it contains new event information, on failure null.
-
Add an user persistent roadblock to collection ( area impact zone type ).
Declaration
Objective-C
- (nullable TrafficEventObject *) addPersistentRoadblock:(nonnull CircleGeographicAreaObject *)circleArea startTime:(nonnull TimeObject *)startUTC expireTime:(nonnull TimeObject *)expireUTC transportMode:(RouteTransportMode)transportMode identifier:(nonnull NSString *)identifier;
Swift
func addPersistentRoadblock(_ circleArea: CircleGeographicAreaObject, startTime startUTC: TimeObject, expireTime expireUTC: TimeObject, transportMode: RouteTransportMode, identifier: String) -> TrafficEventObject?
Parameters
circleArea
The geographic area affected by the roadblock.
startUTC
The roadblock start time in Coordinated Universal Time.
expireUTC
The roadblock expire time in Coordinated Universal Time.
transportMode
The transport mode for which the roadblock applies.
id
The user roadblock id. Can be used to get / delete a defined roadblock
Return Value
The new defined roadblock. On success it contains new event information, on failure null.
-
Remove an user persistent roadblock.
Declaration
Objective-C
- (void)removePersistentRoadblock:(nonnull CoordinatesObject *)location;
Swift
func removePersistentRoadblock(_ location: CoordinatesObject)
Parameters
location
The roadblock start coordinates. @details Coords must be equal with coordsStart provided when the roadblock was defined.
-
Remove all user persistent roadblock.
Declaration
Objective-C
- (void)removeAllPersistentRoadblocks;
Swift
func removeAllPersistentRoadblocks()
-
Get all persistent user roadblocks.
Declaration
Objective-C
- (nonnull NSArray<RouteTrafficEventObject *> *)getPersistentRoadblocks;
Swift
func getPersistentRoadblocks() -> [RouteTrafficEventObject]
-
Remove an user roadblock ( persistent or non-persistent ).
Declaration
Objective-C
- (void)removeUserRoadblock:(nonnull TrafficEventObject *)event;
Swift
func removeUserRoadblock(_ event: TrafficEventObject)
-
Start persistent roadblock notifications.
Declaration
Objective-C
- (void)startPersistentRoadblockNotification;
Swift
func startPersistentRoadblockNotification()
-
Stop persistent roadblock notifications.
Declaration
Objective-C
- (void)stopPersistentRoadblockNotification;
Swift
func stopPersistentRoadblockNotification()
-
Set the traffic delay threshold in minutes.
Declaration
Objective-C
- (void)setTrafficDelayThreshold:(int)delay;
Swift
func setTrafficDelayThreshold(_ delay: Int32)
-
Returns the traffic delay threshold in minutes.
Declaration
Objective-C
- (int)getTrafficDelayThreshold;
Swift
func getTrafficDelayThreshold() -> Int32
-
Enable/disable traffic service. @details Default it is disabled.
Declaration
Objective-C
- (void)setUseTraffic:(TrafficUsage)type;
Swift
func setUseTraffic(_ type: TrafficUsage)
-
Get the use mode.
-
Get the traffic color.
Declaration
Objective-C
- (nullable UIColor *)getTrafficColorForRoute:(nonnull RouteObject *)route;
Swift
func getTrafficColor(forRoute route: RouteObject) -> UIColor?
-
Get the traffic icon id.
Declaration
Objective-C
- (int)getTrafficIconIdForRoute:(nonnull RouteObject *)routeObject;
Swift
func getTrafficIconId(forRoute routeObject: RouteObject) -> Int32