The HERE iOS SDK offers real-time traffic flow and congestion overlays. Traffic information can be displayed on the
NMAMapView (where available) by setting its
trafficInfoVisible property to
YES. While the HERE SDK requires a network data connection to download real time traffic information, the visualization may continue to be displayed even if a connection is lost—until the traffic events expire, or the visibility is toggled.
NMAMapView, you need to switch the map view to one of the following schemes.
Traffic visualization is refreshed when one of the following happens:
- The map is moved by a significant distance
- The map is not moved for 5 minutes
Traffic flow lines are color-coded as follows:
- Green - Normal
- Amber - High
- Red - Very High
- Black - Blocking
The following figure provides an example of traffic visualization:
The traffic information updates contain live traffic event information; these events are represented by various icons on the map. The following figures show examples of different types of traffic events:
Traffic Objects and Events
Traffic events are represented on the map using instances of the
NMATrafficObject proxy object class. These objects may be selected either by tapping on the map (which returns the objects from the
-mapView:didSelectObjects: method in the
NMAMapViewDelegate protocol) or by calling the
-objectsAtPoint: method in
NMAMapView. The underlying event is represented by an instance of
NMATrafficEvent, which may be accessed via the
trafficEvent property in
NMATrafficObject. The properties in
NMATrafficEvent contain information about the event, including type, description, and affected streets.
For more information about the APIs introduced and demonstrated in this section, refer to the API Reference documentation.