Skip to content
dalton edited this page Jun 8, 2011 · 8 revisions

Data to provide

There is no data to provide here: Google API is called directly in ajax with the information you provide listed in the following sections.

Reference is here: http://code.google.com/apis/maps/documentation/javascript/reference.html#DirectionsRequest

Display

<%= gmaps({
       "direction"   => { "data" => { "from" => "Paris, france", "to" => "Toulon, france" } }
            })
 %>

Options

  • avoidHighways: boolean

  • avoidTolls : boolean

  • region : string

  • travelMode : string, "DRIVING", "WALKING" or "BICYCLING"

  • unitSystem : string, "IMPERIAL" or "METRIC"

  • waypoints : Array of strings

  • display_panel : boolean, default to false. If true, displays direction indications in a container. You should set it's id below

  • panel_id: string, provide the id of the container you want to display the instructions

Use Options

<%= 
gmaps({ "direction" => {
                    "data"    => { "from" => "toulon, france", "to" => "paris, france"} , 
       	            "options" => {"waypoints" => ["toulouse, france", "brest, france"], "display_panel" => true, "panel_id" => "instructions"}
       		  }
      })
 %>