Class: Everlog::Inf::Api::GoogleMap
- Inherits:
-
Object
- Object
- Everlog::Inf::Api::GoogleMap
- Defined in:
- lib/everlog/inf/api/googlemap.rb
Instance Method Summary collapse
-
#initialize ⇒ GoogleMap
constructor
A new instance of GoogleMap.
- #screen_name(lat, lon) ⇒ Object
Constructor Details
#initialize ⇒ GoogleMap
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 |