3

I'm trying to search for a location, using an existing google PlaceId.

It is referenced in the documentation to pass the param: google_place_id: true

require 'geocoder'

Geocoder.search("ChIJLU7jZClu5kcR4PcOOO6p3I0", params: {google_place_id: true})

https://github.com/alexreisner/geocoder#google-google

However only empty arrays are getting returned from the search.

Sam Watson
  • 31
  • 3

2 Answers2

3

Geocoder uses a lot of apis. Google is NOT it's default. Also, you'll need an API key. Setting API_KEY:

Geocoder.configure api_key: your API_KEY

Now you can search

Geocoder.search(some_places_id, lookup: :google_places_details)
Carlos Troncoso
  • 669
  • 5
  • 21
1

Try dropping the params keyword:

Geocoder.search("ChIJLU7jZClu5kcR4PcOOO6p3I0", { google_place_id: true })
Joe Masilotti
  • 16,815
  • 6
  • 77
  • 87