LightSDK.native.onLocationChange

功能描述

通过js监听实时地理位置变化事件,需结合接口LightSDK.native.startLocationUpdate使用

支持格式

Json

请求参数:

无

请求调用示例

var cb = (data)=>{
}
LightSDK.native.onLocationChange(params,cb);

返回值说明

字段名 字段类型 说明
latitude string 纬度
longitude string 经度
country string 国家
city string 城市
province string 省
district string 区
street string 街道
streetNumber string 街道号码
adCode string 邮编
字段名 字段类型 说明
callbackId string 回调事件Id

返回字段示例

{
"info": {
"error_code": "0",
"error_message": "success"
},
"data": {
"callbackId": "cbId389473567"
}
}

{
"info": {
"error_code": "0",
"error_message": "success"
},
"data": {
"district": "滨江区",
"city": "杭州市",
"country": "中国",
"street": "江南大道",
"adCode": "330108",
"longitude": 120.17204025898972,
"latitude": 30.191234613107376,
"streetNumber": "3672-1",
"province": "浙江省",
"type":"wgs84",
"altitude":"30.237465"
}
}

注意事项
1.此接口调用成功后会立即回调一次callbackId信息,随后将持续回调位置信息。