netLocationBMap

概述

部网络货运信息交互系统位置信息简介

集成在网络货运企业司机端 APP中,在运单起运到收货的运输过程中,抓取驾驶员位置信息数据,上传至部交互系统。

netLocationBMap 插件概述

本插件封装了部网络货运信息交互系统位置信息原生SDK(百度地图版),提供授权企业信息、开始定位、发送定位、停止定位、暂停定位、重新定位。

插件使用攻略

可以通过部交互系统网站(http://wlhy.mot.gov.cn)或 QQ 运维群 (530051420、129197455)等渠道获取。

插件依赖

-注意:

1.本插件依赖插件【bMap

2.本插件需添加自定义插件【netLocationAppendix】 论坛地址:[货运信息交互系统-百度版](https://developer.yonyou.com/thread-205180-1-1.html)

3.本插件编译IOS固件版本要求>=11.0

4.如编译报错联系QQ:770104707

使用此插件之前建议先配置 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

appId

  • 类型:字符串
  • 描述:(选填)APPID

appSecurity

  • 类型:字符串
  • 描述:(选填)APP安全码

enterpriseSenderCode

  • 类型:字符串
  • 描述:(选填)企业码

environment

  • 类型:字符串
  • 描述:(选填)环境 debug 、release

vehicleNumber

  • 类型:字符串
  • 描述:(必填)车牌号

driverName

  • 类型:字符串
  • 描述:(必填)司机姓名

callback(ret, err)

ret:

  • 类型:JSON 对象
  • 内部字段:
{
    status: true, //初始化状态
    code: 0, //状态码
    eventType: 'onSuccess', //事件类型  onSuccess onFailure
    msg: "onSuccess",//描述
    result:{ //其他结果数据

    }
}

示例代码

var netLocationBMap = api.require('netLocationBMap');
    netLocationBMap.auth({
        appId:"",//APPID
        appSecurity:"",//APP安全码
        enterpriseSenderCode:"",//企业码
        environment:"release",//环境 debug 、release
        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及更高版本

是否仍需要帮助? 请保持联络!
最后更新于 2024/04/24