Module: GoogleMapsApis::Services::Places

Included in:
Client
Defined in:
lib/google_maps_apis/services/places.rb

Overview

Performs requests to the Google Maps Geocoding API.

Instance Method Summary collapse

Instance Method Details

#places_autocomplete(input, components: nil, bounds: nil, types: nil, region: nil, language: nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/google_maps_apis/services/places.rb', line 7

def places_autocomplete(input, components: nil, bounds: nil, types: nil, region: nil, language: nil)
  params = {}

  params[:input] = input
  params[:components] = GoogleMapsApis::Convert.components(components) if components
  params[:bounds] = GoogleMapsApis::Convert.bounds(bounds) if bounds
  params[:region] = region if region
  params[:language] = language if language
  params[:types] = types if types

  return get('/maps/api/place/autocomplete/json', params)[:predictions]
end