This is ruby gem for using Naver Map API.
Add this line to your application's Gemfile:
gem 'naver_map'
And then execute:
$ bundle
Or install it yourself as:
$ gem install naver_map
require 'naver_map'
city_hall = NaverMap.new('input your client id', 'input your client secret')
First you need to confirm your Naver API client id and client secret key. You can confirm it at Naver Developer Application page.
Then you can initialize naver_map
with your client id and client secret key.
city_hall.address_to_coordinates('์์ธํน๋ณ์ ์ค๊ตฌ ์ธ์ข
๋๋ก 110 ์์ธํน๋ณ์์ฒญ')
=> {:x=>126.9783882, :y=>37.5666103}
The address will be converted into coordinates and returned. But coordinates can be plural. In this case, coordinates will be returned in array. And when your address is not clear, then this case occurred frequently. For example your address parameter is '์์ธํน๋ณ์ ์ค๊ตฌ'. Then you'll get many coordinates values.
city_hall.coordinates_to_address(126.9783882, 37.5666103)
=> ["์์ธํน๋ณ์ ์ค๊ตฌ ํํ๋ก1๊ฐ 31", "์์ธํน๋ณ์ ์ค๊ตฌ ์ธ์ข
๋๋ก 110 ์์ธ์์ฒญ"]
The coordinates will be converted into address. And address also can be can be plural.
Bug reports and pull requests are welcome.
MIT