Class: Geocoder::Lookup::AmazonLocationService
- Defined in:
- lib/geocoder/lookups/amazon_location_service.rb
Instance Method Summary collapse
Methods inherited from Base
#cache, #handle, #initialize, #map_link_url, #name, #query_url, #required_api_key_parts, #search, #supported_protocols
Constructor Details
This class inherits a constructor from Geocoder::Lookup::Base
Instance Method Details
#results(query) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/geocoder/lookups/amazon_location_service.rb', line 6 def results(query) params = query..dup # index_name is required # Aws::ParamValidator raises ArgumentError on missing required keys params.merge!(index_name: configuration[:index_name]) # Aws::ParamValidator raises ArgumentError on unexpected keys params.delete(:lookup) resp = if query.reverse_geocode? client.search_place_index_for_position(params.merge(position: query.coordinates.reverse)) else client.search_place_index_for_text(params.merge(text: query.text)) end resp.results end |