简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM