Net Location Bmap
/ Title: netLocationBMap Description: 部网络货运信息交互系统位置信息(百度地图版) /
来自于:770104707@qq.com立即使用
概述
部网络货运信息交互系统位置信息简介
集成在网络货运企业司机端 APP中,在运单起运到收货的运输过程中,抓取驾驶员位置信息数据,上传至部交互系统。
netLocationBMap 模块概述
本模块封装了部网络货运信息交互系统位置信息原生SDK(百度地图版),提供授权企业信息、开始定位、发送定位、停止定位、暂停定位、重新定位。
模块使用攻略
可以通过部交互系统网站(http://wlhy.mot.gov.cn)或 QQ 运维群 (530051420、129197455)等渠道获取。
- 注意:
1.版本模块依赖模块【bMap】
2.本模块也不包含 其他相关依赖,如编译报错或无法使用,请移步论坛搜索 【netLocation】下载相关扩展依赖包
使用此模块之前建议先配置 config.xml 文件,配置完毕,需通过云端编译生效,配置方法如下:
- 名称:netLocationBMap
- 配置示例:
<feature name="netLocationBMap">
<!-- android APPID -->
<param name="android_appId" value="com.x**********nshuquan" />
<!-- android APP安全码 -->
<param name="android_appSecurity" value="ceb3ffb**********1ecaab9f75" />
<!-- ios APPID -->
<param name="ios_appId" value="com.xn**********shuquan" />
<!-- ios APP安全码 -->
<param name="ios_appSecurity" value="ceb3ffb83da**********ecaab9f75" />
<!-- 企业码 -->
<param name="enterpriseSenderCode" value="10**********01" />
<param name="environment" value="debug" />
<!-- 环境:“debug” 接入测试环境, “release”接入 正式环境。-->
</feature>
模块接口
initSdk
sdk 初始化
initSdk({params},callback(ret, err))
params
无
callback(ret, err)
ret:
- 类型:JSON 对象
- 内部字段:
{
status: true, //初始化状态
code: 0, //状态码
eventType: 'onInit', //事件类型
msg: "onInitSdk",//描述
result:{ //其他结果数据
}
}
示例代码
var netLocationBMap = api.require('netLocationBMap');
netLocationBMap.initSdk({
},function(ret, err) {
if (ret.status) {
alert("sdk 初始化成功");
} else {
alert('sdk 初始化失败');
}
});
可用性
iOS系统,Android系统
可提供的1.0.0及更高版本
auth
授权企业信息
auth({params},callback(ret, err))
params
vehicleNumber
- 类型:字符串
- 描述:(必填)车牌号
driverName
- 类型:字符串
- 描述:(必填)司机姓名
callback(ret, err)
ret:
- 类型:JSON 对象
- 内部字段:
{
status: true, //初始化状态
code: 0, //状态码
eventType: 'onSuccess', //事件类型 onSuccess onFailure
msg: "onSuccess",//描述
result:{ //其他结果数据
}
}
示例代码
var netLocation = api.require('netLocationBMap');
netLocationBMap.auth({
vehicleNumber:"辽A123456",//车牌号
driverName:"测试",//司机姓名
}, function(ret, err){
if(ret.status){
}
});
可用性
iOS系统,Android系统
可提供的1.0.0及更高版本
start
开始定位
start({params},callback(ret, err))
params
remark
- 类型:字符串
- 描述:(选填)备注
shippingNoteInfos
- 类型:数组
- 描述:(必填)运单信息列表
[ { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 }, { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 } ]
callback(ret, err)
ret:
- 类型:JSON 对象
- 内部字段:
{
status: true, //初始化状态
code: 0, //状态码
eventType: 'onSuccess', //事件类型 onSuccess onFailure
msg: "onSuccess",//描述
result:{ //其他结果数据
}
}
示例代码
var netLocationBMap = api.require('netLocationBMap');
netLocationBMap.start({
remark:"",//备注
shippingNoteInfos:[
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
},
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
}
]
},function (ret,err){
if(ret.status){
}else{
//错误信息
}
});
可用性
iOS系统,Android系统
可提供的1.0.0及更高版本
send
发送定位
send({params},callback(ret, err))
params
remark
- 类型:字符串
- 描述:(选填)备注
shippingNoteInfos
- 类型:数组
- 描述:(选填)运单信息列表 (为空,运行start填写的信息)
[ { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 }, { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 } ]
callback(ret, err)
ret:
- 类型:JSON 对象
- 内部字段:
{
status: true, //初始化状态
code: 0, //状态码
eventType: 'onSuccess', //事件类型 onSuccess onFailure
msg: "onSuccess",//描述
result:{ //其他结果数据
}
}
示例代码
var netLocationBMap = api.require('netLocationBMap');
netLocationBMap.send({
remark:"",//备注
shippingNoteInfos:[
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
},
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
}
]
},function (ret,err){
if(ret.status){
}else{
//错误信息
}
});
可用性
iOS系统,Android系统
可提供的1.0.0及更高版本
pause
暂停定位
pause({params},callback(ret, err))
params
remark
- 类型:字符串
- 描述:(选填)备注
shippingNoteInfos
- 类型:数组
- 描述:(选填)运单信息列表 (为空,运行start填写的信息)
[ { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 }, { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 } ]
callback(ret, err)
ret:
- 类型:JSON 对象
- 内部字段:
{
status: true, //初始化状态
code: 0, //状态码
eventType: 'onSuccess', //事件类型 onSuccess onFailure
msg: "onSuccess",//描述
result:{ //其他结果数据
}
}
示例代码
var netLocationBMap = api.require('netLocationBMap');
netLocationBMap.pause({
remark:"",//备注
shippingNoteInfos:[
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
},
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
}
]
},function (ret,err){
if(ret.status){
}else{
//错误信息
}
});
可用性
iOS系统,Android系统
可提供的1.0.0及更高版本
stop
停止定位
stop({params},callback(ret, err))
params
remark
- 类型:字符串
- 描述:(选填)备注
shippingNoteInfos
- 类型:数组
- 描述:(选填)运单信息列表 (为空,运行start填写的信息)
[ { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 }, { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 } ]
callback(ret, err)
ret:
- 类型:JSON 对象
- 内部字段:
{
status: true, //初始化状态
code: 0, //状态码
eventType: 'onSuccess', //事件类型 onSuccess onFailure
msg: "onSuccess",//描述
result:{ //其他结果数据
}
}
示例代码
var netLocationBMap = api.require('netLocationBMap');
netLocationBMap.stop({
remark:"",//备注
shippingNoteInfos:[
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
},
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
}
]
},function (ret,err){
if(ret.status){
}else{
//错误信息
}
});
可用性
iOS系统,Android系统
可提供的1.0.0及更高版本
restart
重置定位
restart({params},callback(ret, err))
params
remark
- 类型:字符串
- 描述:(选填)备注
shippingNoteInfos
- 类型:数组
- 描述:(选填)运单信息列表 (为空,运行start填写的信息)
[ { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 }, { shippingNoteNumber:'ZM2021042420001515151',//运单号 serialNumber:'ZM202104242000151515101',//分单号 startCountrySubdivisionCode:'210106',//起点行政区划代码 startLatitude:'',//起点位置经度 startLongitude:'',//起点位置纬度 startLocationText:'',//起点地址文字描述 endCountrySubdivisionCode:'110105',//终点行政区划代码 endLatitude:'',//到达位置经度 endLongitude:'',//到达位置纬度 endLocationText:''//到达地址文字描述 } ]
callback(ret, err)
ret:
- 类型:JSON 对象
- 内部字段:
{
status: true, //初始化状态
code: 0, //状态码
eventType: 'onSuccess', //事件类型 onSuccess onFailure
msg: "onSuccess",//描述
result:{ //其他结果数据
}
}
示例代码
var netLocationBMap = api.require('netLocationBMap');
netLocationBMap.restart({
remark:"",//备注
shippingNoteInfos:[
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
},
{
shippingNoteNumber:'ZM2021042420001515151',//运单号
serialNumber:'ZM202104242000151515101',//分单号
startCountrySubdivisionCode:'210106',//起点行政区划代码
startLatitude:'',//起点位置经度
startLongitude:'',//起点位置纬度
startLocationText:'',//起点地址文字描述
endCountrySubdivisionCode:'110105',//终点行政区划代码
endLatitude:'',//到达位置经度
endLongitude:'',//到达位置纬度
endLocationText:''//到达地址文字描述
}
]
},function (ret,err){
if(ret.status){
}else{
//错误信息
}
});
可用性
iOS系统,Android系统
可提供的1.0.0及更高版本