Project

pointy

0.0
No commit activity in last 3 years
No release in over 3 years
Uses Google Directions API to get a list of points between two locations.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

~> 0.13.1
~> 0.1.1
 Project Readme

Pointy

Uses Google Directions API to get a list of points between two locations.

Installation

Add this line to your application's Gemfile:

gem 'pointy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pointy

Usage

  1. Set the environment variable GOOGLE_DIRECTIONS_API_KEY to your Google Directions API key.

  2. Use the route method to retrieve points between two locations.

    Pointy.route(from, to)

from and to should be hashes of the following format

{
  lat: 55.8580,
  long: -4.2590
}

The returned array of points are of the same format. If you would rather an array of polylines then call Pointy.route_polylines(from, to) instead.

You can also pass in any other query parameters accepted by Google, so you override the API key or transport mode

Pointy.route(from, to, {key: 'my-api-key', mode: 'walking'})

The mode defaults to 'walking' and sensor defaults to false.

Contributing

  1. Fork it ( https://github.com/addjam/pointy/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