6

Google Navigation shows the traffic layer only for a given route. With GoogleMap.setTrafficEnabled(true) I'll get the traffic information for the whole map.

I know how to draw polylines for a route from Google Directions, but how can I turn on the traffic layer only for that route?

Steve Benett
  • 12,843
  • 7
  • 59
  • 79
  • I am also face same problem..can you give updated answer for your question..see my question http://stackoverflow.com/questions/30313161/find-the-traffic-between-two-locations-in-android – Ranjithkumar May 19 '15 at 14:48
  • 1
    @ranjith I'm sorry to say, that I never solved this problem. It seems Google keeps some functionality for their own APIs. Also I haven't programming Android for quiet some time. – Steve Benett May 19 '15 at 17:55

2 Answers2

6

Not possible as of API v2 version 3.1.36. You may want to post a feature request on gmaps-api-issues.

MaciejGórski
  • 22,187
  • 7
  • 70
  • 94
  • No offense but where did you get this info? – Steve Benett May 30 '13 at 19:00
  • @SteveBenett I seem to know the API fairly well. There is no function which lets you do that. `GoogleMap.setTrafficEnabled` is the only traffic-related API. The lecture doesn't take much time: https://developers.google.com/maps/documentation/android/ – MaciejGórski May 30 '13 at 19:05
-1

The difference between these two values (duration and a duration in traffic) indicates how delayed your customer is going to be on their way to or from their location.

Reference: Access Google's Traffic Data through a Web Service

Discussion: http://searchengineland.com/pull-google-maps-traffic-data-into-adwords-with-this-script-library-248934

Community
  • 1
  • 1