Module: GeoMagic

Defined in:
lib/rails/config.rb,
lib/geo_magic/util.rb,
lib/geo_magic/util.rb,
lib/geo_magic/point.rb,
lib/geo_magic/radius.rb,
lib/geo_magic/remote.rb,
lib/geo_magic/location.rb,
lib/geo_magic/calculate.rb,
lib/geo_magic/map_point.rb,
lib/geo_magic/rectangle.rb,
lib/geo_magic/geocode/config.rb,
lib/geo_magic/geocode/geocoder.rb,
lib/geo_magic/geocode/geo_adapter.rb,
lib/geo_magic/geocode/geocode_adapter.rb,
lib/geo_magic/geocode/graticule_adapter.rb

Defined Under Namespace

Modules: Calculate, MapPoints, RailsServiceAdapter, Remote, ServiceAdapter, Util Classes: GeoAdapter, GeoCodeError, GeocodeAdapter, GraticuleAdapter, GraticuleMultiAdapter, Location, MapPoint, Point, Radius, Rectangle

Class Method Summary collapse

Class Method Details

.geo_coder(options = {:type => :geocode, :service => :google}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/geo_magic/geocode/geocoder.rb', line 12

def geo_coder options = {:type => :geocode, :service => :google}
  service_name = options[:service_name] || :google
  type  = options[:type] || :geocode
  env   = options[:env]

  services = options[:services] || options[:service] || :google
  
  clazz = "GeoMagic::#{type.to_s.classify}Adapter".constantize
  
  clazz.new services, env
end

.geocode(location_str) ⇒ Object



24
25
26
# File 'lib/geo_magic/geocode/geocoder.rb', line 24

def geocode location_str      
  geo_coder.geocode location_str
end