Class: Graticule::Geocoder::LocalSearchMaps

Inherits:
Base
  • Object
show all
Defined in:
lib/graticule/geocoder/local_search_maps.rb

Overview

A library for lookup of coordinates with geo.localsearchmaps.com/

See emad.fano.us/blog/?p=277

Constant Summary

Constants inherited from Base

Base::USER_AGENT

Instance Method Summary collapse

Constructor Details

#initializeLocalSearchMaps

Returns a new instance of LocalSearchMaps.



10
11
12
# File 'lib/graticule/geocoder/local_search_maps.rb', line 10

def initialize
  @url = URI.parse 'http://geo.localsearchmaps.com/'
end

Instance Method Details

#locate(params) ⇒ Object

This web service will handle some addresses outside the US if given more structured arguments than just a string address So allow input as a hash for the different arguments (:city, :country, :zip)



17
18
19
# File 'lib/graticule/geocoder/local_search_maps.rb', line 17

def locate(params)
  get params.is_a?(String) ? {:loc => params} : map_attributes(location_from_params(params))
end