# cordova-plugin-gdlocation

> 使用高德地图进行定位

Latest version **1.0.47** (published 2018-03-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-gdlocation
pnpm add cordova-plugin-gdlocation
yarn add cordova-plugin-gdlocation
bun add cordova-plugin-gdlocation
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.47 |
| Published | 2018-03-02 |
| First published | 2018-01-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 39 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | ngd |
| Maintainers | nx6313 |
| Keywords | ecosystem:cordova, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-gdlocation
- Repository: https://github.com/nx6313/gdLocation
- Homepage: https://github.com/nx6313/gdLocation#readme
- Issues: https://github.com/nx6313/gdLocation/issues
- npm.io page: https://npm.io/package/cordova-plugin-gdlocation

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.47 (latest) — 2018-03-02
- 1.0.46 — 2018-02-11
- 1.0.45 — 2018-02-11
- 1.0.44 — 2018-02-11
- 1.0.43 — 2018-02-11
- 1.0.42 — 2018-02-11
- 1.0.41 — 2018-02-11
- 1.0.40 — 2018-02-10
- 1.0.39 — 2018-02-10
- 1.0.38 — 2018-01-31
- 1.0.37 — 2018-01-24
- 1.0.36 — 2018-01-23
- 1.0.35 — 2018-01-23
- 1.0.34 — 2018-01-23
- 1.0.33 — 2018-01-22
- … 4 more at https://npm.io/package/cordova-plugin-gdlocation/versions

## README

使用高德地图进行定位
==========================================

★提供的功能有：定位、导航、语音合成播报、记录移动距离、计算两坐标的距离
------------------------------------------
<br>

>使用方法
>>- start(onceFlag, interval, callBack) 开始定位
>>- stop() 结束定位
>>- showRoute(ttsAppId, startObj, endObj) 执行导航
>>- stopRoute(stopReason) 停止导航
>>- startSpeak(ttsAppId, speekContent) 语音合成播报
>>- startRecord(interval, minDis, maxDis) 开始记录移动距离
>>- stopRecord() 停止记录移动距离
>>- calcNavInfo(oneLatLng, twoLatLng) 计算两坐标的距离

#### 插件安装
```cmd
$ npm install cordova-plugin-gdlocation
$ cordova plugin add cordova-plugin-gdlocation --variable API_KEY=高德地图中应用的API_KEY
```

#### 方法说明
>☆ **start(onceFlag, interval, callBack)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;开始进行定位**
<br><br>
● `onceFlag: Boolean`<br>
布尔值参数<br>
表示是否为一次定位逻辑，设置为 true 表示进行一次定位请求，设置为 false 表示进行连续的定位请求<br>
● `interval: Number`<br>
数值参数<br>
连续定位的时间间隔，单位 毫秒，默认值 2000, 如果参数 `onceFlag` 设置为 true，该参数无效<br>
● `callBack: Function`<br>
回调方法<br>
当获取到位置信息后，回调该方法，返回位置信息
<br><br><br>
>**☆ stop()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;结束定位**
<br><br><br>
>**☆ showRoute(ttsAppId, startObj, endObj)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;执行导航**
<br><br>
● `ttsAppId: String`<br>
字符串参数<br>
导航使用的讯飞语音AppId
<br>
● `startObj: JSONObject`<br>
JSON对象参数<br>
导航的起点数据，格式为：{ startName: string, startLat: double, startLng: double }
<br>
● `endObj: JSONObject`<br>
JSON对象参数<br>
导航的终点数据，格式为：{ endName: string, endLat: double, endLng: double }
<br><br><br>
>**☆ stopRoute(stopReason, callBack)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;停止导航**
<br><br>
● `stopReason: String`<br>
字符串参数<br>
停止导航的原因<br>
● `callBack: Function`<br>
回调方法<br>
当导航停止后，回调该方法，无信息返回
<br><br><br>
>**☆ startSpeak(ttsAppId, speekContent)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;语音合成播报**
<br><br>
● `ttsAppId: String`<br>
字符串参数<br>
语音播报使用的讯飞语音AppId<br>
● `speekContent: String`<br>
字符串参数<br>
语音播报的文字内容
<br><br><br>
>**☆ startRecord(interval, minDis, maxDis)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;开始记录移动距离**
<br><br>
● `interval: Number`<br>
数值参数<br>
连续返回移动距离记录的时间间隔，单位 毫秒，默认值 2000<br>
● `minDis: Float`<br>
数值参数<br>
允许忽略掉每次移动距离的最小值<br>
● `maxDis: Float`<br>
数值参数<br>
允许忽略掉每次移动距离的最大值
<br><br><br>
>**☆ stopRecord()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;停止记录移动距离**
<br><br><br>
>**☆ calcNavInfo(oneLatLng, twoLatLng)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;计算两坐标的距离**
<br><br>
● `oneLatLng: JSONObject`<br>
JSON对象参数<br>
第一个坐标点，格式为：{ lat: double, lng: double }
<br>
● `twoLatLng: JSONObject`<br>
JSON对象参数<br>
第二个坐标点，格式为：{ lat: double, lng: double }

联系作者
-----------------------------------------------
- ``Email``&nbsp;&nbsp;&nbsp;2559635030@qq.com
<br><br><br>
![](https://pandao.github.io/editor.md/examples/images/4.jpg)

---
_Source: https://npm.io/package/cordova-plugin-gdlocation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
