● 监听实时地理位置变化事件onLocationChange

分类:位置

是否支持H5:不支持

参数

function listener

实时地理位置变化事件的监听函数

参数

Object res

属性 类型 说明
latitude number 纬度
longitude number 经度
speed number 速度,单位 m/s
accuracy number 位置的精确度
altitude number 高度,单位 m
verticalAccuracy number 垂直精度,单位 m(Android 无法获取,返回 0)
horizontalAccuracy number 水平精度,单位 m

调用示例

原生
wx.onLocationChange(function (res) {
    console.log(' start location change', res)
})
小程序团队 © 2020-2021 all right reserved,powered by Gitbook文件修订时间: 2026-01-05 11:12:01

results matching ""

    No results matching ""