Sorry, you need to enable JavaScript to visit this website.

Traffic examples

Traffic examples

Have a look at our functional examples to see how easy it is to implement search features with the Maps SDK.

Speed up development by using our sample code snippets in your app. Try all of this out with the Maps SDK Examples app!

Traffic incident list

Give your users information about traffic incidents around so they can adjust their commute according to the traffic situation.

Sample use case: You are about to drive and you want to avoid roads with traffic incidents on your way.
Use the traffic incident list to have the overview of which streets might be blocked or congested due to accidents,
road works or possible rain, ice, flooding, etc.

Use the code snippet below to try this in your app.

TTLatLngBounds bounds = TTLatLngBoundsMake(CLLocationCoordinate2DMake(51.544300, -0.176267), CLLocationCoordinate2DMake(51.465582, -0.071777));
TTIncidentDetailsQuery *query = [[TTIncidentDetailsQueryBuilder createWithStyle:TTTrafficIncidentStyleTypeS1 withBoundingBox:bounds withZoom:12 withTrafficModelID:@"-1"] build];

 

An example implementation of the callback of the response from traffic incident details service:

[[TTTrafficIncidents new] incidentDetailsWithQuery:query completionHandler:^(TTIncidentDetailsResponse * _Nullable response, TTResponseError * _Nullable error) {
    self.incidents = [response incidents];
    [self.trafficTableView reloadData];
}];

 



image

Incidents list.

image

Incidents list with clusters.

You are here