It would be awesome if geocoder supported the google directions API to turn an array of addresses (or a string with a "to" separator) into a geoPHP LineString representing the route.

RESTful API is here: https://developers.google.com/maps/documentation/directions/

Comments

basvredeling’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Isn't this functionality more suitable for another module? It's a completely different API after all. My best guess is that you need the getdirections module or something similar.

If you must go the custom route consider this:
map directions differ from geocoding not only because they require different result type parsing, but also because you can give a lot of extra input parameters (mode of transport, at least 2 points: start & finish). Essential features of any custom map directions module would be something like this:

  • basic distance calculations between 2 points, geodetic curve or even straight line
  • simple linestring rendering between two or more points (which could indeed be fetched via geocoder)
  • abstraction layer to make requests to multiple route planning / map directions APIs, say Google or Tom Tom
  • at least 1 working api connector
  • handle stuff like simple A to B requests, or more advanced request: avoiding certain roads, tunnels, adding "via" waypoints, setting a preferred mode of transport, etc
  • advanced transport-route / waypoint map rendering for traffic purposes
  • travel time comparisons

For now, this is a won't fix afaic.