Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 880
Prasanna Avatar asked Jan 20 '26 08:01

Prasanna


1 Answers

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.

like image 117
Jpsy Avatar answered Jan 21 '26 21:01

Jpsy