diff --git a/app/models/configuration.rb b/app/models/configuration.rb index a95ec8652..3b3a13654 100644 --- a/app/models/configuration.rb +++ b/app/models/configuration.rb @@ -27,6 +27,11 @@ module Configuration # This will be the case if you are using pow (http://pow.cx/) GOOGLE_MAPS_KEY = 'ABQIAAAAo-lZBjwKTxZxJsD-PJnp8RTctXwaglzRZcFAUhNsPfHMAK74xRSSE3HhjcyVtlJHXKjyRyk_3L4CYA' + # If you have Google Maps API for Business (OpenAustralia Foundation gets it through the Google Maps API + # grants programme for charities) uncomment and fill out the two lines below + #GOOGLE_MAPS_CLIENT_ID = "xxxxxxxxxxx" + #GOOGLE_MAPS_CRYPTOGRAPHIC_KEY = "xxxxxxxxxxx" + # Google Analytics key GOOGLE_ANALYTICS_KEY = "UA-3107958-5" diff --git a/config/initializers/geokit_config.rb b/config/initializers/geokit_config.rb index f1303963c..02d36f230 100644 --- a/config/initializers/geokit_config.rb +++ b/config/initializers/geokit_config.rb @@ -26,8 +26,12 @@ # This is your Google Maps geocoder key. # See http://www.google.com/apis/maps/signup.html # and http://www.google.com/apis/maps/documentation/#Geocoding_Examples - Geokit::Geocoders::google = 'REPLACE_WITH_YOUR_GOOGLE_KEY' - + #Geokit::Geocoders::google = 'REPLACE_WITH_YOUR_GOOGLE_KEY' + + if defined?(Configuration::GOOGLE_MAPS_CLIENT_ID) + Geokit::Geocoders::google_client_id = Configuration::GOOGLE_MAPS_CLIENT_ID + Geokit::Geocoders::google_cryptographic_key = Configuration::GOOGLE_MAPS_CRYPTOGRAPHIC_KEY + end # This is your username and password for geocoder.us. # To use the free service, the value can be set to nil or false. For # usage tied to an account, the value should be set to username:password.