1.0.47 • Published 6 years ago

cordova-plugin-gdlocation v1.0.47

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

使用高德地图进行定位

★提供的功能有:定位、导航、语音合成播报、记录移动距离、计算两坐标的距离

使用方法

  • start(onceFlag, interval, callBack) 开始定位
  • stop() 结束定位
  • showRoute(ttsAppId, startObj, endObj) 执行导航
  • stopRoute(stopReason) 停止导航
  • startSpeak(ttsAppId, speekContent) 语音合成播报
  • startRecord(interval, minDis, maxDis) 开始记录移动距离
  • stopRecord() 停止记录移动距离
  • calcNavInfo(oneLatLng, twoLatLng) 计算两坐标的距离

插件安装

$ npm install cordova-plugin-gdlocation
$ cordova plugin add cordova-plugin-gdlocation --variable API_KEY=高德地图中应用的API_KEY

方法说明

start(onceFlag, interval, callBack)     开始进行定位 onceFlag: Boolean 布尔值参数 表示是否为一次定位逻辑,设置为 true 表示进行一次定位请求,设置为 false 表示进行连续的定位请求interval: Number 数值参数 连续定位的时间间隔,单位 毫秒,默认值 2000, 如果参数 onceFlag 设置为 true,该参数无效callBack: Function 回调方法 当获取到位置信息后,回调该方法,返回位置信息 ☆ stop()     结束定位 ☆ showRoute(ttsAppId, startObj, endObj)     执行导航 ttsAppId: String 字符串参数 导航使用的讯飞语音AppId startObj: JSONObject JSON对象参数 导航的起点数据,格式为:{ startName: string, startLat: double, startLng: double } endObj: JSONObject JSON对象参数 导航的终点数据,格式为:{ endName: string, endLat: double, endLng: double } ☆ stopRoute(stopReason, callBack)     停止导航 stopReason: String 字符串参数 停止导航的原因callBack: Function 回调方法 当导航停止后,回调该方法,无信息返回 ☆ startSpeak(ttsAppId, speekContent)     语音合成播报 ttsAppId: String 字符串参数 语音播报使用的讯飞语音AppIdspeekContent: String 字符串参数 语音播报的文字内容 ☆ startRecord(interval, minDis, maxDis)     开始记录移动距离 interval: Number 数值参数 连续返回移动距离记录的时间间隔,单位 毫秒,默认值 2000minDis: Float 数值参数 允许忽略掉每次移动距离的最小值maxDis: Float 数值参数 允许忽略掉每次移动距离的最大值 ☆ stopRecord()     停止记录移动距离 ☆ calcNavInfo(oneLatLng, twoLatLng)     计算两坐标的距离 oneLatLng: JSONObject JSON对象参数 第一个坐标点,格式为:{ lat: double, lng: double } twoLatLng: JSONObject JSON对象参数 第二个坐标点,格式为:{ lat: double, lng: double }

联系作者

  • Email   2559635030@qq.com npm.io
1.0.47

6 years ago

1.0.46

6 years ago

1.0.45

6 years ago

1.0.44

6 years ago

1.0.43

6 years ago

1.0.42

6 years ago

1.0.41

6 years ago

1.0.40

6 years ago

1.0.39

6 years ago

1.0.38

6 years ago

1.0.37

6 years ago

1.0.36

6 years ago

1.0.35

6 years ago

1.0.34

6 years ago

1.0.33

6 years ago

1.0.32

6 years ago

1.0.31

6 years ago

1.0.30

6 years ago

1.0.29

6 years ago