Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Google Distance Matrix API support #2629

Closed
kirantpatil opened this issue Dec 1, 2016 · 6 comments
Closed

[Feature Request] Google Distance Matrix API support #2629

kirantpatil opened this issue Dec 1, 2016 · 6 comments

Comments

@kirantpatil
Copy link

kirantpatil commented Dec 1, 2016

I would like to make use of google distance matrix api to get the time to travel for the route which includes traffic duration of traffic.

https://developers.google.com/maps/documentation/distance-matrix/

How can we achieve it ?

Sample API output:

https://maps.googleapis.com/maps/api/distancematrix/json?origins=MajesticBengaluru&destinations=RajajinagarBengaluru&departure_time=1479294521&mode=driving&key=xxxxxxxxxx
{
   "destination_addresses" : [ "Rajaji Nagar, Bengaluru, Karnataka, India" ],
   "origin_addresses" : [ "Majestic, Bengaluru, Karnataka, India" ],
   "rows" : [
      {
         "elements" : [
            {
               "distance" : {
                  "text" : "3.7 km",
                  "value" : 3745
               },
               "duration" : {
                  "text" : "13 mins",
                  "value" : 756
               },
               "duration_in_traffic" : {
                  "text" : "14 mins",
                  "value" : 832
               },
               "status" : "OK"
            }
         ]
      }
   ],
   "status" : "OK"
}

Thanks.

@tananaev
Copy link
Member

tananaev commented Dec 1, 2016

We would need a more open alternative before we can implement it.

@kirantpatil
Copy link
Author

I don't think we have much alternative except following, found in https://github.com/perliedman/leaflet-routing-machine.

Find the way from A to B on a Leaflet map. The plugin supports multiple backends:

OSRM - builtin and used by default
Mapbox Directions API - builtin with the class L.Routing.Mapbox
GraphHopper - through plugin lrm-graphopper
Mapzen Valhalla - through plugin lrm-valhalla
TomTom Online Routing API - through plugin lrm-tomtom by Mathias Rohnstock

@tananaev
Copy link
Member

tananaev commented Dec 2, 2016

I'm sure there are alternatives based on OSM data.

@kirantpatil
Copy link
Author

@tananaev: How about using http://opentraffic.io/ ?

@tananaev
Copy link
Member

The link that you provided doesn't have much information.

@kirantpatil
Copy link
Author

closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants