BaiduGeocoder
使用百度地图API进行地址定位坐标、坐标定位地址、名称定位地址。
安装
$ gem install baidu_geocoder
使用
调用
require 'baidu_geocoder'
include 'BaiduGeocoder'
## get_location_by_addr
loc = Geocoder.get_location_by_addr(addr)
## get_address_by_name
addr = Geocoder.get_address_by_name(name)
## get_address_by_loc
addr = Geocoder.get_address_by_loc(lat, lng)
- tips: BaiduMapApi需要申请 MapAk. 为了避免因为ak限制问题,您也可以传入自己的ak(申请地址)
loc = Geocoder.get_location_by_addr(addr, your_ak)
命令行
License
The gem is available as open source under the terms of the MIT License.