Skip to content

Commit

Permalink
Merge pull request #1666 from noma4i/master
Browse files Browse the repository at this point in the history
Add Language support for AWS Locations service
  • Loading branch information
alexreisner authored Nov 6, 2024
2 parents 19f3cd1 + 02bba5b commit e4e2a88
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/geocoder/lookups/amazon_location_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ def results(query)
params.merge!(index_name: configuration[:index_name])

# Aws::ParamValidator raises ArgumentError on unexpected keys
params.delete(:lookup)

params.delete(:lookup)

# Inherit language from configuration
params.merge!(language: configuration[:language])

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

Expand Down

0 comments on commit e4e2a88

Please sign in to comment.