Sha256: b2cd8c36b20b4368a4e3d6febf4beb57710bb0846c200b42be9afb795e325500

Contents?: true

Size: 924 Bytes

Versions: 1

Compression:

Stored size: 924 Bytes

Contents

= Google::Geo

A simple, elegant library for getting geocoding information from Google Maps. Very much inspired by the google-geocode gem, but completely dependency free!

== Examples

  geo = Google::Geo.new API_KEY

  addresses = geo.locate '1600 Amphitheatre Parkway, Mountain View, CA'
  
  addresses.size # 1, :locate always returns an Array
  
  address = addresses.first

  address.country      # 'US'
  address.city         # 'Mountain View'
  address.full_address # '1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA'

  address.query        # '1600 Amphitheatre Parkway, Mountain View, CA'
  address.accuracy     # 8

In the case of sufficiently vague queries, Google::Geo will return more than one:

  addresses = geo.locate 'hell'

  addresses.size                  # 2
  addresses.map { |a| a.state } # ['PA', 'NC']

== Contributors

Seth Thomas Rasmussen - http://sethrasmussen.com - sethrasmussen@gmail.com

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
google-geo-2.0 README