You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

google_maps_api-distance_matrix

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google_maps_api-distance_matrix

0.2.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

GoogleMapsAPI::DistanceMatrix

This is a wrapper around the Google Maps Distance Matrix API.

Installation

Add this line to your application's Gemfile:

gem 'google_maps_api-distance_matrix'

And then execute:

$ bundle

Or install it yourself as:

$ gem install google_maps_api-distance_matrix

Usage

GoogleMapsAPI::DistanceMatrix.calculate(origins, destinations, options = {})

Origins and destinations are arrays of strings or anything that supports to_ary. Options is a Symbols Hash with optional parameters. (See https://developers.google.com/maps/documentation/distancematrix/#RequestParameters for more information).

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

Examples:

origins = ["350, 5th Ave, NY", "100, 56th St, NY", [40.764291, -73.979169], ...]
destinations = ["673, 45th St, NY", [40.763641,-73.987473], ...]
options = {:language => 'pt'}
GoogleMapsAPI::DistanceMatrix.calculate(origins, destinations, options)
# => #<GoogleMapsAPI::DistanceMatrix::Response:0x00000001f2b510...>

The GoogleMapsAPI::DistanceMatrix::Response object mimics the API JSON structure.

Contributing

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

  • Fork it ( https://github.com/zavan/google_maps_api-distance_matrix/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • 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

FAQs

Package last updated on 28 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts