Search code examples
javascriptgoogle-mapsdirections

Google maps direction summary from API


Is it possible to get the following summary from the google direction service api:

enter image description here

There is a summary property returned by the API but it doesn't matcch the summaries on google. (see screen grab)

enter image description here


Solution

  • Google Maps App != Google Maps APIs and Service

    Just to set the correct expectations, you shouldn't expect the Google Maps APIs and Web Services and the Google Maps App to work in the exact same way at all times.

    The Google Maps App gathers data from many different sources, such as Wikis, local business listings or Google+ information. The Directions API on the other hand uses a mix of information from the Geocoding API with other APIs to determine the best path to a given location.

    What now?

    In short, you can't expect these two different things to return the same, and the Directions API is not equipped to return all the data you are looking for.

    You can however try the following:

    • Make multiple requests (as you pointed) and use the optional alternatives parameter;
    • Mix you data with data from third parties, like Google does.

    Hope it helps !