Class: Naver::Map
Overview
Naver Map API
Class Method Summary collapse
-
.geocode(params = {}) ⇒ Object
주소를 좌표로 변환.
-
.reverse_geocode(params = {}) ⇒ Object
좌표를 주소로 변환.
-
.static_map(params = {}) ⇒ Object
StaticMap 지정된 좌표의 네이버 지도 이미지를 출력.
Methods inherited from Client
#connection, connection, connection=, parse
Class Method Details
.geocode(params = {}) ⇒ Object
주소를 좌표로 변환
7 8 9 |
# File 'lib/naver/map.rb', line 7 def geocode(params = {}) parse(JSON.parse(connection.get("/v1/map/geocode", params).body)["result"]) end |
.reverse_geocode(params = {}) ⇒ Object
좌표를 주소로 변환
13 14 15 16 |
# File 'lib/naver/map.rb', line 13 def reverse_geocode(params = {}) params = { query: "#{params[:lat]}, #{params[:lng]}" } parse(JSON.parse(connection.get("/v1/map/reversegeocode", params).body)["result"]) end |
.static_map(params = {}) ⇒ Object
StaticMap 지정된 좌표의 네이버 지도 이미지를 출력
21 22 23 |
# File 'lib/naver/map.rb', line 21 def static_map(params = {}) connection.get("/v1/map/staticmap.bin", params).body end |