Prasanna
Prasanna

Reputation: 688

Driving directions with traffic

How do I receive driving time between two locations with traffic. This information is displayed on iPhone maps application, when 'Show Traffic' option is selected.

Appreciate your help.

Upvotes: 3

Views: 414

Answers (1)

Jpsy
Jpsy

Reputation: 20862

You have to buy in as a >>Maps business customer and set the durationInTraffic property of the >>DirectionsRequest object to true:

durationInTraffic (optional) specifies whether the DirectionsLeg result should include a duration that takes into account current traffic conditions. This feature is only available for Maps for Business customers. The time in current traffic will only be returned if traffic information is available in the requested area.

Without being a business customer you will not be able to take the current traffic situation into account for your directions calculations, but you can still >>activate the traffic layer in Maps to show the current traffic situation on your map.

Upvotes: 2

Related Questions