No commit activity in last 3 years
No release in over 3 years
Wrapper around the Google Maps Directions API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.6
>= 0
< 4, >= 3.0.0.beta2

Runtime

 Project Readme

GoogleMapsAPI::Directions

This is a wrapper around the Google Maps Directions API.

Installation

Add this line to your application's Gemfile:

gem 'google_maps_api-directions'

And then execute:

$ bundle

Or install it yourself as:

$ gem install google_maps_api-directions

Usage

GoogleMapsAPI::Directions.route(origin, destination, options = {})

Origin and destination can be an a string or anything that supports to_ary. Options is a Symbols Hash with optional parameters. (See https://developers.google.com/maps/documentation/directions/#RequestParameters for more information).

For Google Business/Enterprise requests, include the :key, :client and optionally, :channel in the options hash.

Examples:

origin = "350, 5th Ave, NY"
destination = [40.777552, -73.954732]
options = {:language => 'pt'}
GoogleMapsAPI::Directions.route(origin, destination, options)
# => #<GoogleMapsAPI::Directions::Response:0x00000001f2b510...>

The GoogleMapsAPI::Directions::Response mimics the API JSON structure.

If you wish to call #coordinates on GoogleMapsAPI::Directions::EncodedPolyline objects, you will need to install the https://rubygems.org/gems/polylines gem.

Contributing

I am new to Ruby and Testing. We need better specs.

  1. Fork it ( https://github.com/zavan/google_maps_api-directions/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Important

  • Do not touch the version;
  • Write specs for new features;
  • Be independent of Rails stuff;
  • All specs must pass.

Also see