getGpsInfo
获取gps信息
#请求参数
Prop |
Type |
Required |
Default |
Description |
param |
Object |
Y |
{} 属性: accuracy: { Type: Number, Default: 3 , Description: (定位的精确度) 1、低精度 ,仅用设备定位模式 2、中精度 ,低功耗定位模式 3、高精度 ,高精度定位模式 } alwaysAuthorization: { Type: Number, Default: 0 , Description: (是否开启实时定位功能) 0 只返回一次GPS信息(默认) 1 APP在前台时,每移动distanceFilter的距离返回一次回调 2 无论APP在前后台,每移动distanceFilter的距离返回一次回调(注意耗电) } distanceFilter: { Type: String, Default: 10 , Description: 每移动多少米回调一次定位信息(alwaysAuthorization 为1 或2 时有效,单位为米) } isReqAuthen: { // ^6.4 Type: Boolean, Default: true , Description: 当 APP 没有位置权限的时候,是否弹出去设置权限的提示,安卓默认是true } |
请求参数 |
#接口调用示例
this.$bridge
.getGpsInfo(param)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
this.$bridge
.getGpsInfo(
param,
res => {
this.$alert(res)
},
err => {
this.$toast(err)
}
)
#返回参数
Prop |
Type |
Default |
Description |
status |
Number |
N/A |
0 获取GPS成功 |
province ^5.0.0 |
String |
N/A |
省名字 |
city ^5.0.0 |
String |
N/A |
城市名字 |
cityCode ^5.0.0 |
String |
N/A |
城市编码 |
district ^5.0.0 |
String |
N/A |
区域名称 |
longitude |
String |
N/A |
经度 |
latitude |
String |
N/A |
纬度 |
Prop |
Type |
Default |
Description |
errorCode |
Number |
N/A |
-1 没有权限 |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具