geokit-rails 2.3.2 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +80 -0
- data/.gitignore +44 -37
- data/CHANGELOG.md +106 -96
- data/CONFIG.markdown +67 -67
- data/Gemfile +3 -3
- data/MIT-LICENSE +19 -19
- data/README.markdown +726 -726
- data/Rakefile +17 -17
- data/gemfiles/rails7.1.gemfile +11 -0
- data/gemfiles/{rails3.gemfile → rails7.2.gemfile} +7 -7
- data/gemfiles/{rails4.gemfile → rails8.0.gemfile} +7 -8
- data/gemfiles/{rails5.gemfile → rails8.1.gemfile} +7 -8
- data/geokit-rails.gemspec +34 -33
- data/lib/generators/geokit_rails/install_generator.rb +13 -13
- data/lib/generators/templates/geokit_config.rb +100 -100
- data/lib/geokit-rails/acts_as_mappable/class_methods.rb +299 -0
- data/lib/geokit-rails/acts_as_mappable/glue.rb +54 -0
- data/lib/geokit-rails/acts_as_mappable.rb +78 -425
- data/lib/geokit-rails/adapters/abstract.rb +30 -30
- data/lib/geokit-rails/adapters/mysql.rb +21 -21
- data/lib/geokit-rails/adapters/mysql2.rb +8 -8
- data/lib/geokit-rails/adapters/mysql2spatial.rb +8 -8
- data/lib/geokit-rails/adapters/oracleenhanced.rb +32 -32
- data/lib/geokit-rails/adapters/postgresql.rb +21 -21
- data/lib/geokit-rails/adapters/sqlite.rb +53 -53
- data/lib/geokit-rails/adapters/sqlserver.rb +45 -45
- data/lib/geokit-rails/{core_extensions.rb → distance_collection.rb} +8 -8
- data/lib/geokit-rails/geocoder_control.rb +19 -19
- data/lib/geokit-rails/ip_geocode_lookup.rb +44 -48
- data/lib/geokit-rails/railtie.rb +37 -37
- data/lib/geokit-rails/version.rb +3 -3
- data/lib/geokit-rails.rb +11 -9
- data/test/acts_as_mappable_test.rb +486 -478
- data/test/adapter_resolution_test.rb +46 -0
- data/test/boot.rb +40 -32
- data/test/database.yml +31 -28
- data/test/distance_collection_test.rb +42 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/stylesheets/application.css +1 -0
- data/test/dummy/app/channels/application_cable/channel.rb +4 -0
- data/test/dummy/app/channels/application_cable/connection.rb +4 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/controllers/location_aware_controller.rb +43 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +7 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/application_record.rb +3 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +15 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +33 -0
- data/test/dummy/config/application.rb +22 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +68 -0
- data/test/dummy/config/environments/production.rb +87 -0
- data/test/dummy/config/environments/test.rb +60 -0
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +8 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/permissions_policy.rb +11 -0
- data/test/dummy/config/locales/en.yml +33 -0
- data/test/dummy/config/puma.rb +43 -0
- data/test/dummy/config/routes.rb +6 -0
- data/test/dummy/config/storage.yml +34 -0
- data/test/dummy/config.ru +6 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/storage/.keep +0 -0
- data/test/dummy/tmp/.keep +0 -0
- data/test/dummy/tmp/pids/.keep +0 -0
- data/test/dummy/tmp/storage/.keep +0 -0
- data/test/fixtures/companies.yml +9 -9
- data/test/fixtures/custom_locations.yml +61 -61
- data/test/fixtures/locations.yml +61 -61
- data/test/fixtures/mock_addresses.yml +16 -16
- data/test/fixtures/mock_families.yml +2 -2
- data/test/fixtures/mock_houses.yml +8 -8
- data/test/fixtures/mock_organizations.yml +4 -4
- data/test/fixtures/mock_people.yml +4 -4
- data/test/ip_geocode_lookup_test.rb +53 -0
- data/test/models/company.rb +2 -2
- data/test/models/custom_location.rb +11 -11
- data/test/models/location.rb +3 -3
- data/test/models/mock_address.rb +3 -3
- data/test/models/mock_family.rb +4 -4
- data/test/models/mock_house.rb +2 -2
- data/test/models/mock_organization.rb +5 -5
- data/test/models/mock_person.rb +6 -6
- data/test/models/store.rb +2 -2
- data/test/schema.rb +61 -61
- data/test/tasks.rake +37 -37
- data/test/test_helper.rb +83 -56
- metadata +137 -37
- data/.travis.yml +0 -29
- data/test/ip_geocode_lookup_test.disabled.rb +0 -82
data/Rakefile
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
require 'bundler'
|
|
2
|
-
Bundler::GemHelper.install_tasks
|
|
3
|
-
|
|
4
|
-
require 'rdoc/task'
|
|
5
|
-
Rake::RDocTask.new do |rdoc|
|
|
6
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
|
7
|
-
|
|
8
|
-
rdoc.rdoc_dir = 'rdoc'
|
|
9
|
-
rdoc.title = "geokit-rails #{version}"
|
|
10
|
-
rdoc.rdoc_files.include('README*')
|
|
11
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
load 'test/tasks.rake'
|
|
15
|
-
|
|
16
|
-
desc 'Default: run unit tests.'
|
|
17
|
-
task :default => :test
|
|
1
|
+
require 'bundler'
|
|
2
|
+
Bundler::GemHelper.install_tasks
|
|
3
|
+
|
|
4
|
+
require 'rdoc/task'
|
|
5
|
+
Rake::RDocTask.new do |rdoc|
|
|
6
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
|
7
|
+
|
|
8
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
9
|
+
rdoc.title = "geokit-rails #{version}"
|
|
10
|
+
rdoc.rdoc_files.include('README*')
|
|
11
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
load 'test/tasks.rake'
|
|
15
|
+
|
|
16
|
+
desc 'Default: run unit tests.'
|
|
17
|
+
task :default => :test
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
group :development, :test do
|
|
4
|
+
gem 'activerecord', '~> 7.1.0'
|
|
5
|
+
# Rails 7.1's sqlite3 adapter requires sqlite3 1.x
|
|
6
|
+
gem 'sqlite3', '~> 1.4'
|
|
7
|
+
# Rails 7.1's test runner doesn't support minitest 6
|
|
8
|
+
gem 'minitest', '< 6'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
gemspec :path => "../"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
group :development, :test do
|
|
4
|
-
gem 'activerecord', '~>
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
gemspec :path => "../"
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
group :development, :test do
|
|
4
|
+
gem 'activerecord', '~> 7.2.0'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
gemspec :path => "../"
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
group :development, :test do
|
|
4
|
-
gem 'activerecord', '~>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
gemspec :path => "../"
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
group :development, :test do
|
|
4
|
+
gem 'activerecord', '~> 8.0.0'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
gemspec :path => "../"
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
group :development, :test do
|
|
4
|
-
gem 'activerecord', '~>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
gemspec :path => "../"
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
group :development, :test do
|
|
4
|
+
gem 'activerecord', '~> 8.1.0'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
gemspec :path => "../"
|
data/geokit-rails.gemspec
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
require File.expand_path("../lib/geokit-rails/version", __FILE__)
|
|
3
|
-
|
|
4
|
-
Gem::Specification.new do |spec|
|
|
5
|
-
spec.name = "geokit-rails"
|
|
6
|
-
spec.version = GeokitRails::VERSION
|
|
7
|
-
spec.authors = ["Michael Noack", "Andre Lewis", "Bill Eisenhauer", "Jeremy Lecour"]
|
|
8
|
-
spec.email = ["michael+geokit@noack.com.au", "andre@earthcode.com", "bill_eisenhauer@yahoo.com", "jeremy.lecour@gmail.com"]
|
|
9
|
-
spec.summary = "Integrate Geokit with Rails"
|
|
10
|
-
spec.description = "Official Geokit plugin for Rails/ActiveRecord. Provides location-based goodness for your Rails app. Requires the Geokit gem."
|
|
11
|
-
spec.summary = "Geokit helpers for rails apps."
|
|
12
|
-
spec.homepage = "http://github.com/geokit/geokit-rails"
|
|
13
|
-
spec.license = "MIT"
|
|
14
|
-
|
|
15
|
-
spec.files = `git ls-files`.split($/)
|
|
16
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
17
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
18
|
-
spec.require_paths = ["lib"]
|
|
19
|
-
|
|
20
|
-
spec.add_dependency 'rails', '>= 3.0'
|
|
21
|
-
spec.add_dependency 'geokit', '~> 1.5'
|
|
22
|
-
spec.add_development_dependency "bundler", "> 1.0"
|
|
23
|
-
spec.add_development_dependency "simplecov", "
|
|
24
|
-
spec.add_development_dependency "simplecov-rcov"
|
|
25
|
-
spec.add_development_dependency '
|
|
26
|
-
spec.add_development_dependency '
|
|
27
|
-
spec.add_development_dependency
|
|
28
|
-
spec.add_development_dependency
|
|
29
|
-
spec.add_development_dependency
|
|
30
|
-
spec.add_development_dependency "
|
|
31
|
-
spec.add_development_dependency "
|
|
32
|
-
spec.add_development_dependency "
|
|
33
|
-
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
require File.expand_path("../lib/geokit-rails/version", __FILE__)
|
|
3
|
+
|
|
4
|
+
Gem::Specification.new do |spec|
|
|
5
|
+
spec.name = "geokit-rails"
|
|
6
|
+
spec.version = GeokitRails::VERSION
|
|
7
|
+
spec.authors = ["Michael Noack", "Andre Lewis", "Bill Eisenhauer", "Jeremy Lecour"]
|
|
8
|
+
spec.email = ["michael+geokit@noack.com.au", "andre@earthcode.com", "bill_eisenhauer@yahoo.com", "jeremy.lecour@gmail.com"]
|
|
9
|
+
spec.summary = "Integrate Geokit with Rails"
|
|
10
|
+
spec.description = "Official Geokit plugin for Rails/ActiveRecord. Provides location-based goodness for your Rails app. Requires the Geokit gem."
|
|
11
|
+
spec.summary = "Geokit helpers for rails apps."
|
|
12
|
+
spec.homepage = "http://github.com/geokit/geokit-rails"
|
|
13
|
+
spec.license = "MIT"
|
|
14
|
+
|
|
15
|
+
spec.files = `git ls-files`.split($/)
|
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
18
|
+
spec.require_paths = ["lib"]
|
|
19
|
+
|
|
20
|
+
spec.add_dependency 'rails', '>= 3.0'
|
|
21
|
+
spec.add_dependency 'geokit', '~> 1.5'
|
|
22
|
+
spec.add_development_dependency "bundler", "> 1.0"
|
|
23
|
+
spec.add_development_dependency "simplecov", ">= 0.16.1"
|
|
24
|
+
spec.add_development_dependency "simplecov-rcov"
|
|
25
|
+
spec.add_development_dependency 'net-http'
|
|
26
|
+
spec.add_development_dependency 'rake'
|
|
27
|
+
spec.add_development_dependency 'rexml'
|
|
28
|
+
spec.add_development_dependency "mocha", "~> 2.0"
|
|
29
|
+
spec.add_development_dependency 'coveralls_reborn'
|
|
30
|
+
spec.add_development_dependency "mysql2", ">= 0.2"
|
|
31
|
+
# spec.add_development_dependency "activerecord-mysql2spatial-adapter"
|
|
32
|
+
spec.add_development_dependency "pg", ">= 0.10"
|
|
33
|
+
spec.add_development_dependency "sqlite3"
|
|
34
|
+
end
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
module GeokitRails
|
|
2
|
-
module Generators
|
|
3
|
-
class InstallGenerator < Rails::Generators::Base
|
|
4
|
-
source_root File.expand_path("../../templates", __FILE__)
|
|
5
|
-
|
|
6
|
-
desc "Creates a sample Geokit initializer."
|
|
7
|
-
|
|
8
|
-
def copy_initializer
|
|
9
|
-
copy_file "geokit_config.rb", "config/initializers/geokit_config.rb"
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
1
|
+
module GeokitRails
|
|
2
|
+
module Generators
|
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
|
4
|
+
source_root File.expand_path("../../templates", __FILE__)
|
|
5
|
+
|
|
6
|
+
desc "Creates a sample Geokit initializer."
|
|
7
|
+
|
|
8
|
+
def copy_initializer
|
|
9
|
+
copy_file "geokit_config.rb", "config/initializers/geokit_config.rb"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
# These defaults are used in Geokit::Mappable.distance_to and acts_as_mappable
|
|
2
|
-
Geokit::default_units = :miles # others :kms, :nms, :meters
|
|
3
|
-
Geokit::default_formula = :sphere
|
|
4
|
-
|
|
5
|
-
# This is the timeout value in seconds to be used for calls to the geocoder web
|
|
6
|
-
# services. For no timeout at all, comment out the setting. The timeout unit
|
|
7
|
-
# is in seconds.
|
|
8
|
-
Geokit::Geocoders::request_timeout = 3
|
|
9
|
-
|
|
10
|
-
# This setting can be used if web service calls must be routed through a proxy.
|
|
11
|
-
# These setting can be nil if not needed, otherwise, a valid URI must be
|
|
12
|
-
# filled in at a minimum. If the proxy requires authentication, the username
|
|
13
|
-
# and password can be provided as well.
|
|
14
|
-
# Geokit::Geocoders::proxy = 'https://user:password@host:port'
|
|
15
|
-
|
|
16
|
-
# This is your yahoo application key for the Yahoo Geocoder.
|
|
17
|
-
# See http://developer.yahoo.com/faq/index.html#appid
|
|
18
|
-
# and http://developer.yahoo.com/maps/rest/V1/geocode.html
|
|
19
|
-
# Geokit::Geocoders::YahooGeocoder.key = 'REPLACE_WITH_YOUR_YAHOO_KEY'
|
|
20
|
-
# Geokit::Geocoders::YahooGeocoder.secret = 'REPLACE_WITH_YOUR_YAHOO_SECRET'
|
|
21
|
-
|
|
22
|
-
# This is your Google Maps geocoder keys (all optional).
|
|
23
|
-
# See http://www.google.com/apis/maps/signup.html
|
|
24
|
-
# and http://www.google.com/apis/maps/documentation/#Geocoding_Examples
|
|
25
|
-
# Geokit::Geocoders::GoogleGeocoder.client_id = ''
|
|
26
|
-
# Geokit::Geocoders::GoogleGeocoder.cryptographic_key = ''
|
|
27
|
-
# Geokit::Geocoders::GoogleGeocoder.channel = ''
|
|
28
|
-
|
|
29
|
-
# You can also use the free API key instead of signed requests
|
|
30
|
-
# See https://developers.google.com/maps/documentation/geocoding/#api_key
|
|
31
|
-
# Geokit::Geocoders::GoogleGeocoder.api_key = ''
|
|
32
|
-
|
|
33
|
-
# You can also set multiple API KEYS for different domains that may be directed
|
|
34
|
-
# to this same application.
|
|
35
|
-
# The domain from which the current user is being directed will automatically
|
|
36
|
-
# be updated for Geokit via
|
|
37
|
-
# the GeocoderControl class, which gets it's begin filter mixed
|
|
38
|
-
# into the ActionController.
|
|
39
|
-
# You define these keys with a Hash as follows:
|
|
40
|
-
# Geokit::Geocoders::google = {
|
|
41
|
-
# 'rubyonrails.org' => 'RUBY_ON_RAILS_API_KEY',
|
|
42
|
-
# ' ruby-docs.org' => 'RUBY_DOCS_API_KEY' }
|
|
43
|
-
|
|
44
|
-
# This is your username and password for geocoder.us.
|
|
45
|
-
# To use the free service, the value can be set to nil or false. For
|
|
46
|
-
# usage tied to an account, the value should be set to username:password.
|
|
47
|
-
# See http://geocoder.us
|
|
48
|
-
# and http://geocoder.us/user/signup
|
|
49
|
-
# Geokit::Geocoders::UsGeocoder.key = 'username:password'
|
|
50
|
-
|
|
51
|
-
# This is your authorization key for geocoder.ca.
|
|
52
|
-
# To use the free service, the value can be set to nil or false. For
|
|
53
|
-
# usage tied to an account, set the value to the key obtained from
|
|
54
|
-
# Geocoder.ca.
|
|
55
|
-
# See http://geocoder.ca
|
|
56
|
-
# and http://geocoder.ca/?register=1
|
|
57
|
-
# Geokit::Geocoders::CaGeocoder.key = 'KEY'
|
|
58
|
-
|
|
59
|
-
# This is your username key for geonames.
|
|
60
|
-
# To use this service either free or premium, you must register a key.
|
|
61
|
-
# See http://www.geonames.org
|
|
62
|
-
# Geokit::Geocoders::GeonamesGeocoder.key = 'KEY'
|
|
63
|
-
|
|
64
|
-
# Most other geocoders need either no setup or a key
|
|
65
|
-
# Geokit::Geocoders::BingGeocoder.key = ''
|
|
66
|
-
# Geokit::Geocoders::MapQuestGeocoder.key = ''
|
|
67
|
-
# Geokit::Geocoders::YandexGeocoder.key = ''
|
|
68
|
-
# Geokit::Geocoders::MapboxGeocoder.key = 'ACCESS_TOKEN'
|
|
69
|
-
# Geokit::Geocoders::OpencageGeocoder.key = 'some_api_key'
|
|
70
|
-
|
|
71
|
-
# Geonames has a free service and a premium service, each using a different URL
|
|
72
|
-
# GeonamesGeocoder.premium = true will use http://ws.geonames.net (premium)
|
|
73
|
-
# GeonamesGeocoder.premium = false will use http://api.geonames.org (free)
|
|
74
|
-
# Geokit::Geocoders::GeonamesGeocoder.premium = false
|
|
75
|
-
|
|
76
|
-
# require "external_geocoder.rb"
|
|
77
|
-
# Please see the section "writing your own geocoders" for more information.
|
|
78
|
-
# Geokit::Geocoders::external_key = 'REPLACE_WITH_YOUR_API_KEY'
|
|
79
|
-
|
|
80
|
-
# This is the order in which the geocoders are called in a failover scenario
|
|
81
|
-
# If you only want to use a single geocoder, put a single symbol in the array.
|
|
82
|
-
# Valid symbols are :google, :yahoo, :us, and :ca.
|
|
83
|
-
# Be aware that there are Terms of Use restrictions on how you can use the
|
|
84
|
-
# various geocoders. Make sure you read up on relevant Terms of Use for each
|
|
85
|
-
# geocoder you are going to use.
|
|
86
|
-
# Geokit::Geocoders::provider_order = [:google,:us]
|
|
87
|
-
|
|
88
|
-
# The IP provider order. Valid symbols are :ip,:geo_plugin.
|
|
89
|
-
# As before, make sure you read up on relevant Terms of Use for each.
|
|
90
|
-
# Geokit::Geocoders::ip_provider_order = [:external,:geo_plugin,:ip]
|
|
91
|
-
|
|
92
|
-
# Disable HTTPS globally. This option can also be set on individual
|
|
93
|
-
# geocoder classes.
|
|
94
|
-
# Geokit::Geocoders::secure = false
|
|
95
|
-
|
|
96
|
-
# Control verification of the server certificate for geocoders using HTTPS
|
|
97
|
-
# Geokit::Geocoders::ssl_verify_mode = OpenSSL::SSL::VERIFY_(PEER/NONE)
|
|
98
|
-
# Setting this to VERIFY_NONE may be needed on systems that don't have
|
|
99
|
-
# a complete or up to date root certificate store. Only applies to
|
|
100
|
-
# the Net::HTTP adapter.
|
|
1
|
+
# These defaults are used in Geokit::Mappable.distance_to and acts_as_mappable
|
|
2
|
+
Geokit::default_units = :miles # others :kms, :nms, :meters
|
|
3
|
+
Geokit::default_formula = :sphere
|
|
4
|
+
|
|
5
|
+
# This is the timeout value in seconds to be used for calls to the geocoder web
|
|
6
|
+
# services. For no timeout at all, comment out the setting. The timeout unit
|
|
7
|
+
# is in seconds.
|
|
8
|
+
Geokit::Geocoders::request_timeout = 3
|
|
9
|
+
|
|
10
|
+
# This setting can be used if web service calls must be routed through a proxy.
|
|
11
|
+
# These setting can be nil if not needed, otherwise, a valid URI must be
|
|
12
|
+
# filled in at a minimum. If the proxy requires authentication, the username
|
|
13
|
+
# and password can be provided as well.
|
|
14
|
+
# Geokit::Geocoders::proxy = 'https://user:password@host:port'
|
|
15
|
+
|
|
16
|
+
# This is your yahoo application key for the Yahoo Geocoder.
|
|
17
|
+
# See http://developer.yahoo.com/faq/index.html#appid
|
|
18
|
+
# and http://developer.yahoo.com/maps/rest/V1/geocode.html
|
|
19
|
+
# Geokit::Geocoders::YahooGeocoder.key = 'REPLACE_WITH_YOUR_YAHOO_KEY'
|
|
20
|
+
# Geokit::Geocoders::YahooGeocoder.secret = 'REPLACE_WITH_YOUR_YAHOO_SECRET'
|
|
21
|
+
|
|
22
|
+
# This is your Google Maps geocoder keys (all optional).
|
|
23
|
+
# See http://www.google.com/apis/maps/signup.html
|
|
24
|
+
# and http://www.google.com/apis/maps/documentation/#Geocoding_Examples
|
|
25
|
+
# Geokit::Geocoders::GoogleGeocoder.client_id = ''
|
|
26
|
+
# Geokit::Geocoders::GoogleGeocoder.cryptographic_key = ''
|
|
27
|
+
# Geokit::Geocoders::GoogleGeocoder.channel = ''
|
|
28
|
+
|
|
29
|
+
# You can also use the free API key instead of signed requests
|
|
30
|
+
# See https://developers.google.com/maps/documentation/geocoding/#api_key
|
|
31
|
+
# Geokit::Geocoders::GoogleGeocoder.api_key = ''
|
|
32
|
+
|
|
33
|
+
# You can also set multiple API KEYS for different domains that may be directed
|
|
34
|
+
# to this same application.
|
|
35
|
+
# The domain from which the current user is being directed will automatically
|
|
36
|
+
# be updated for Geokit via
|
|
37
|
+
# the GeocoderControl class, which gets it's begin filter mixed
|
|
38
|
+
# into the ActionController.
|
|
39
|
+
# You define these keys with a Hash as follows:
|
|
40
|
+
# Geokit::Geocoders::google = {
|
|
41
|
+
# 'rubyonrails.org' => 'RUBY_ON_RAILS_API_KEY',
|
|
42
|
+
# ' ruby-docs.org' => 'RUBY_DOCS_API_KEY' }
|
|
43
|
+
|
|
44
|
+
# This is your username and password for geocoder.us.
|
|
45
|
+
# To use the free service, the value can be set to nil or false. For
|
|
46
|
+
# usage tied to an account, the value should be set to username:password.
|
|
47
|
+
# See http://geocoder.us
|
|
48
|
+
# and http://geocoder.us/user/signup
|
|
49
|
+
# Geokit::Geocoders::UsGeocoder.key = 'username:password'
|
|
50
|
+
|
|
51
|
+
# This is your authorization key for geocoder.ca.
|
|
52
|
+
# To use the free service, the value can be set to nil or false. For
|
|
53
|
+
# usage tied to an account, set the value to the key obtained from
|
|
54
|
+
# Geocoder.ca.
|
|
55
|
+
# See http://geocoder.ca
|
|
56
|
+
# and http://geocoder.ca/?register=1
|
|
57
|
+
# Geokit::Geocoders::CaGeocoder.key = 'KEY'
|
|
58
|
+
|
|
59
|
+
# This is your username key for geonames.
|
|
60
|
+
# To use this service either free or premium, you must register a key.
|
|
61
|
+
# See http://www.geonames.org
|
|
62
|
+
# Geokit::Geocoders::GeonamesGeocoder.key = 'KEY'
|
|
63
|
+
|
|
64
|
+
# Most other geocoders need either no setup or a key
|
|
65
|
+
# Geokit::Geocoders::BingGeocoder.key = ''
|
|
66
|
+
# Geokit::Geocoders::MapQuestGeocoder.key = ''
|
|
67
|
+
# Geokit::Geocoders::YandexGeocoder.key = ''
|
|
68
|
+
# Geokit::Geocoders::MapboxGeocoder.key = 'ACCESS_TOKEN'
|
|
69
|
+
# Geokit::Geocoders::OpencageGeocoder.key = 'some_api_key'
|
|
70
|
+
|
|
71
|
+
# Geonames has a free service and a premium service, each using a different URL
|
|
72
|
+
# GeonamesGeocoder.premium = true will use http://ws.geonames.net (premium)
|
|
73
|
+
# GeonamesGeocoder.premium = false will use http://api.geonames.org (free)
|
|
74
|
+
# Geokit::Geocoders::GeonamesGeocoder.premium = false
|
|
75
|
+
|
|
76
|
+
# require "external_geocoder.rb"
|
|
77
|
+
# Please see the section "writing your own geocoders" for more information.
|
|
78
|
+
# Geokit::Geocoders::external_key = 'REPLACE_WITH_YOUR_API_KEY'
|
|
79
|
+
|
|
80
|
+
# This is the order in which the geocoders are called in a failover scenario
|
|
81
|
+
# If you only want to use a single geocoder, put a single symbol in the array.
|
|
82
|
+
# Valid symbols are :google, :yahoo, :us, and :ca.
|
|
83
|
+
# Be aware that there are Terms of Use restrictions on how you can use the
|
|
84
|
+
# various geocoders. Make sure you read up on relevant Terms of Use for each
|
|
85
|
+
# geocoder you are going to use.
|
|
86
|
+
# Geokit::Geocoders::provider_order = [:google,:us]
|
|
87
|
+
|
|
88
|
+
# The IP provider order. Valid symbols are :ip,:geo_plugin.
|
|
89
|
+
# As before, make sure you read up on relevant Terms of Use for each.
|
|
90
|
+
# Geokit::Geocoders::ip_provider_order = [:external,:geo_plugin,:ip]
|
|
91
|
+
|
|
92
|
+
# Disable HTTPS globally. This option can also be set on individual
|
|
93
|
+
# geocoder classes.
|
|
94
|
+
# Geokit::Geocoders::secure = false
|
|
95
|
+
|
|
96
|
+
# Control verification of the server certificate for geocoders using HTTPS
|
|
97
|
+
# Geokit::Geocoders::ssl_verify_mode = OpenSSL::SSL::VERIFY_(PEER/NONE)
|
|
98
|
+
# Setting this to VERIFY_NONE may be needed on systems that don't have
|
|
99
|
+
# a complete or up to date root certificate store. Only applies to
|
|
100
|
+
# the Net::HTTP adapter.
|