YY. AmapService
高德 LBS 开放平台数据交互服务接口,其只是对高德开放平台LBS服务的简单包装, 如果你不想使用这个服务类,你也可以自己去写一个与之类似的工具函数
creation
constructor()
警告
所有的方法均为静态方法
example
js
//请去申请自己的KEY ,并配置YY.AppKey = 'your key'
YY.AmapService.keywords({
keywords: "苏州"
}, function(response) {
console.log(response);
});
methods
TIP
static 表示静态方法, 即对象直接访问, 无需new
static
keywords(opts, callback)
- 关键字搜索
- 参数
- {Object}
opts
: 相关搜索条件- {String}
keywords
: 关键字 - {String}
types
: 类别 - {String}
city
: 城市
- {String}
- {Function}
callback
: 回调函数
- {Object}
static
around(opts, callback)
- 周边查询
- 参数
- {Object}
opts
: 相关搜索条件- {String}
location
: 坐标,ex:'123.333,31.232323' - {Number}
radisu
:搜索半径 - {String}
types
: 类别 - {String}
city
: 城市
- {String}
- {Function}
callback
: 回调函数
- {Object}
static
polygon(opts, callback)
- 多边形查询
- 参数
- {Object}
opts
: 相关搜索条件- {String}
pollygon
: 坐标,ex:'123.333,31.232323;.......' - {String}
types
: 类别 - {String}
city
: 城市
- {String}
- {Function}
callback
: 回调函数
- {Object}
static
detail(opts, callback)
- 详情查询
- 参数
- {Object}
opts
: 相关搜索条件 - {Function}
callback
: 回调函数
- {Object}
static
inputTips(opts, callback)
输入提示,智能感知
参数
- {Object}
opts
: 相关搜索条件 - {String}id
: - {Function}
callback
: 回调函数
- {Object}
static
geocode(opts, callback)
- 地址解析
- 参数
- {Object}
opts
: 相关搜索条件- {String}
address
:地址;ex:苏州市星湖街 15 号
- {String}
- {Function}
callback
: 回调函数
- {Object}
static
deGeocode(opts, callback)
- 逆地址解析
- 参数
- {Object}
opts
: 相关搜索条件- {String}
location
:坐标,ex:'123.333,31.232323'
- {String}
- {Function}
callback
: 回调函数
- {Object}
static
district(opts, callback)
- 行政区查询
- 参数
- {Object}
opts
: 相关搜索条件- {String}
keywords
:
- {String}
- {Function}
callback
: 回调函数
- {Object}
static
walking(opts, callback)
- 步行路线查询
- 参数
- {Object}
opts
: 相关搜索条件- {String}
origin
: 起始点 - {String}
destination
: 结束点
- {String}
- {Function}
callback
: 回调函数
- {Object}
static
bicycling(opts, callback)
- 骑行路线查询
- 参数
- {Object}
opts
: 相关搜索条件- {String}
origin
: 起始点 - {String}
destination
: 结束点
- {String}
- {Function}
callback
: 回调函数
- {Object}
static
driving(opts, callback)
- 驾车路线规划
- 参数
- {Object}
opts
: 相关搜索条件- {String}
origin
: 起始点 - {String}
destination
: 结束点 - {String}
strategy
: 模式,详情请参阅高德 LBS api
- {String}
- {Function}
callback
: 回调函数
- {Object}
static
truck(opts, callback)
货车路线规划
参数
{Object}
opts
: 相关搜索条件- {String}
origin
: 起始点 - {String}
destination
: 结束点 - {String}
size
: 车辆型号 - {String}
height
: 车辆大小 - {String}
width
: 车辆宽度 - {String}
load
: 车辆自身重量 - {String}
weight
: 车辆最大额定载重 - {String}
axis
: 车辆载重 - {String}
strategy
: 模式,详情请参阅高德 LBS api
- {String}
{Function}
callback
: 回调函数
static
busStation(opts, callback)
- 公交站点查询
- 参数
{Object}
opts
: 相关搜索条件- {String}
keywords
: - {String}
city
:
- {String}
{Function}
callback
: 回调函数
static
busLine(opts, callback)
- 公交线路查询
- 参数
{Object}
opts
: 相关搜索条件- {String}
keywords
: - {String}
city
:
- {String}
{Function}
callback
: 回调函数
static
bus(opts, callback)
- 公交换乘规划
- 参数
{Object}
opts
: 相关搜索条件- {String}
city
: - {String}
origin
: 起始点 - {String}
destination
: 结束点 - {String}
strategy
: 模式,详情请参阅高德 LBS api
- {String}
{Function}
callback
: 回调函数
static
ipLocation(opts, callback)
- ip 定位
- 参数
{Object}
opts
: 相关条件{String}
ip
: ip 的值 ex:127.0.0.1{YY.Map}
map
: 地图对象
{Function}
callback
: 回调函数