No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
This library brings the Google Maps API Web Services to your Ruby/RoR application. It supports both JSON and XML response formats.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 12.0
~> 3.5

Runtime

>= 3.0.0, ~> 3.0
>= 1.7.1, ~> 1.7
 Project Readme

Ruby Client for Google Maps Services

Build Status Coverage Status Gem Version

Description

This library brings the Google Maps API Web Services to your Ruby/RoR application.

The Ruby Client for Google Maps Services is a Ruby Client library for the following Google Maps APIs:

It supports both JSON and XML response formats.

Please make sure you are using the latest release to get the newest features.

Requirements

  • Ruby 2.1 or later.
  • A Google Maps API key.
  • Client ID and Client Secret (for Google Maps APIs Premium Plan customers).

Installation

Add this line to your application's Gemfile:

gem 'googlemaps-services'

And then execute:

$ bundle

Or install it yourself as:

$ gem install googlemaps-services

Documentation

View the reference documentation.

Usage

This example uses the Directions API with an API key:

  require 'googlemaps/services/client'
  require 'googlemaps/services/directions'

  include GoogleMaps::Services

  client = GoogleClient.new(key: 'Add API key here', response_format: :json)
  directions = Directions.new(client)

  # Get directions via public transit in JSON format.
  # To return the result in XML format, change the Client response_format parameter to :xml.
  result = directions.query(origin: '75 9th Ave, New York, NY',
                            destination: 'MetLife Stadium Dr East Rutherford, NJ 07073',
                            mode: 'transit',
                            departure_time: Time.now)
  # Print the result
  puts result

For more usage examples, check out the reference documentation.

Contributing

Bug reports, Pull requests and Stars are always welcome. For bugs and feature requests, please create an issue.

Donate

  • Donate
  • Bitcoin: 1EdwqtXhojU4LGhTwBLT1JpTb1d71oA89o

License

The gem is available as open source under the terms of the MIT License.