README.markdown in geokit-1.8.4 vs README.markdown in geokit-1.8.5

- old
+ new

@@ -42,23 +42,33 @@ * Geocoder.ca - for Canada; may require authentication as well. * Geonames - a free geocoder * Bing * Yandex * MapQuest +* Geocod.io ### address geocoders that also provide reverse geocoding -* Google - requires an API key. Also supports multiple results and bounding box/country code biasing. +* Google - Supports multiple results and bounding box/country code biasing. Also supports Maps API for Business keys; see the configuration section below. * FCC * Open Street Map ### IP address geocoders * IP - geocodes an IP address using hostip.info's web service. * Geoplugin.net -- another IP address geocoder * RIPE * MaxMind * freegeoip.net +### HTTPS-supporting geocoders +* Google +* Yahoo +* Bing +* FCC +* MapQuest + +Options to control the use of HTTPS are described below in the Configuration section. + ## QUICK START ```ruby irb> require 'rubygems' irb> require 'geokit' @@ -115,10 +125,14 @@ # and http://www.google.com/apis/maps/documentation/#Geocoding_Examples Geokit::Geocoders::GoogleGeocoder.client_id = '' Geokit::Geocoders::GoogleGeocoder.cryptographic_key = '' Geokit::Geocoders::GoogleGeocoder.channel = '' + # You can also use the free API key instead of signed requests + # See https://developers.google.com/maps/documentation/geocoding/#api_key + Geokit::Geocoders::GoogleGeocoder.api_key = '' + # You can also set multiple API KEYS for different domains that may be directed to this same application. # The domain from which the current user is being directed will automatically be updated for Geokit via # the GeocoderControl class, which gets it's begin filter mixed into the ActionController. # You define these keys with a Hash as follows: #Geokit::Geocoders::google = { 'rubyonrails.org' => 'RUBY_ON_RAILS_API_KEY', 'ruby-docs.org' => 'RUBY_DOCS_API_KEY' } @@ -157,10 +171,20 @@ Geokit::Geocoders::provider_order = [:google,:us] # The IP provider order. Valid symbols are :ip,:geo_plugin. # As before, make sure you read up on relevant Terms of Use for each. # Geokit::Geocoders::ip_provider_order = [:external,:geo_plugin,:ip] + + # Disable HTTPS globally. This option can also be set on individual + # geocoder classes. + Geokit::Geocoders::secure = false + + # Control verification of the server certificate for geocoders using HTTPS + Geokit::Geocoders::ssl_verify_mode = OpenSSL::SSL::VERIFY_(PEER/NONE) + # Setting this to VERIFY_NONE may be needed on systems that don't have + # a complete or up to date root certificate store. Only applies to + # the Net::HTTP adapter. ``` ### Google Geocoder Tricks The Google Geocoder sports a number of useful tricks that elevate it a little bit above the rest of the currently supported geocoders. For starters, it returns a `suggested_bounds` property for all your geocoded results, so you can more easily decide where and how to center a map on the places you geocode. Here's a quick example: @@ -185,11 +209,11 @@ irb> res = Geokit::Geocoders::GoogleGeocoder.geocode('Syracuse', :bias => 'it') irb> res.full_address => "Syracuse, Italy" ``` -Alternatively, we can speficy the geocoding bias as a bounding box object. Say we wanted to geocode the Winnetka district in Los Angeles. +Alternatively, we can specify the geocoding bias as a bounding box object. Say we wanted to geocode the Winnetka district in Los Angeles. ```ruby irb> res = Geokit::Geocoders::GoogleGeocoder.geocode('Winnetka') irb> res.full_address => "Winnetka, IL, USA" @@ -256,10 +280,10 @@ do_geocode. ## WRITING YOUR OWN GEOCODERS If you would like to write your own geocoders, you can do so by requiring 'geokit' or 'geokit/geocoders.rb' in a new file and subclassing the base class (which is class "Geocoder"). -You must then also require such extenal file back in your main geokit configuration. +You must then also require such external file back in your main geokit configuration. ```ruby require "geokit" module Geokit