Skip to content
内容大纲
官方QQ交流群
pc端ui:468705115   点此加入
移动端ui:468217742   点此加入
技术交流1:87208295   点此加入
技术交流2:787747122   点此加入
官网
云控制台
开放平台
关注微信公众号
代码仓库: 码云

LBS位置服务

获取定位 getLocation

  • 参数说明
参数类型是否必填默认说明
ipString需要搜索的IP地址(仅支持国内)若用户不填写IP,则取客户http之中的请求来进行定位
js
import { getDistrict } from 
// 原型
uniLbs.getLocation(ip).then((res) => {})
// 例子
uniLbs.getLocation().then((res) => {
})

获取地区 getDistrict

  • 参数说明
参数类型是否必填说明
keywordstring查询关键字
  • 示例
js
import { getDistrict } from 
// 原型
getDistrict(keyword).then((res) => {})
// 例子
getDistrict('福建省').then((res) => {
})

路径规划 getRoutes

  • 参数说明
参数类型是否必填默认说明
paramObjectapi接口参数
traffic_typeStringdriving交通工具类型

param参数详情

json
{
	origin: '26.074054,119.318390',
  destination: '26.074054,119.318390',
}
参数类型是否必填说明
originString起点坐标
destinationString终点坐标

其他参数请参考以及交通工具类型请参考 腾讯地图, 高德地图

  • 示例
js
// 原型
getRoutes(param, traffic_type).then((res) => {})

// 例子
let param = {
  origin: '26.074054,119.318390',
  destination: '26.074054,119.318390',
}
getRoutes(param, 'bicycling').then((res) => {
  this.routes = res.result.routes;
})

Copyright © 2017 10yun.com | 十云提供计算服务-IPV6 | ctocode组开发