Class: Everlog::Inf::Api::GoogleMap

Inherits:
Object
  • Object
show all
Defined in:
lib/everlog/inf/api/googlemap.rb

Instance Method Summary collapse

Constructor Details

#initializeGoogleMap

Returns a new instance of GoogleMap.



5
6
7
# File 'lib/everlog/inf/api/googlemap.rb', line 5

def initialize
  Geocoder.configure(language: :ja, units: :km)
end

Instance Method Details

#screen_name(lat, lon) ⇒ Object



9
10
11
12
13
# File 'lib/everlog/inf/api/googlemap.rb', line 9

def screen_name(lat, lon)
  Geocoder.search("#{lat},#{lon}").first.formatted_address
rescue => e
  raise InfrastructureGoogleMapError, "screen_name error / #{e.message}"
end