Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Directions API

In the JSON output, there is a field "maneuver" within a "step". In this "turn-left", "turn-right", "turn-slight-left", etc. Example is here

Where could I find the definition of the "maneuver" field, and the list of possible values? There is no relevant description here

Thanks in advance

like image 903
user2633218 Avatar asked Jul 30 '13 08:07

user2633218


People also ask

Is Google Directions API free?

The Directions API uses a pay-as-you-go pricing model. Directions API requests generate calls to one of two SKUs depending on the type of request: basic or advanced. Along with the overall Google Terms of Use, there are usage limits specific to the Directions API.

What is Direction API?

The Directions API is a web service that uses an HTTP request to return JSON or XML-formatted directions between locations. Directions is available in several forms: as a standalone API. as part of the client-side Maps JavaScript API. for server-side use as part of the Client Libraries for Google Maps Web Services.


2 Answers

Here is a visual for the lazy ones :)

Can't believe Google did not document this yet...

maneuver contains the action to take for the current step (turn left, merge, straight, etc.).

This field is used to determine which icon to display, and can contain one of the following values:

Google Maps Direction API - Maneuvers

like image 116
Jason Avatar answered Oct 04 '22 15:10

Jason


UPD

Believe it or not, but finally they documented it! Please see here.


according to this gmaps-api-issue I think google not in hurry to document this part of api :(

But I can help with this issue at least with following... The "maneuver" field is the short description of step's action. I suppose google's script uses it for applying css classes to direction panel. I noticed that icon for each step depends on css class ".adp-{maneuver_name}". Css file for panel contains 18 classes with that mask and I had extracted list of maneuvers:

  • turn-sharp-left
  • uturn-right
  • turn-slight-right
  • merge
  • roundabout-left
  • roundabout-right
  • uturn-left
  • turn-slight-left
  • turn-left
  • ramp-right
  • turn-right
  • fork-right
  • straight
  • fork-left
  • ferry-train
  • turn-sharp-right
  • ramp-left
  • ferry

During the work I found two additional values of the "maneuver" field, which doesn't have css classes:

  • keep-left
  • keep-right

I can't guarantee fullness of this list, but I used this list in my project and it works properly.

like image 44
turach Avatar answered Oct 04 '22 15:10

turach