Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-gizwits-geofencing

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-gizwits-geofencing - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

src/android/AMapActivity.java

2

package.json
{
"name": "cordova-gizwits-geofencing",
"version": "1.1.1",
"version": "1.1.2",
"description": "Gizwits Geofencing tool",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,2 +8,10 @@ # Gizwits 地理围栏工具

## 安装移除
``` bash
cordova plugin add cordova-gizwits-geofencing
(Android添加插件需要传入高德地图的AppKey,添加方法如下:cordova plugin add cordova-gizwits-geofencing --variable AMAP_KEY=your_key)
cordova plugin rm cordova-gizwits-geofencing
```
## 接口使用说明

@@ -141,2 +149,61 @@

12. 获取当前位置 getCurrentLocation
``` js
cordova.plugins.gizGeofencing.getCurrentLocation(func (coordinate) {
// coordinate 当前位置GPS坐标 {"latitude": 23.123456, "longitude": 123.123456}
}, func (errorCode) {
// errorCode 错误码,请参照最后的错误码表。
});
```
13. 解析地址 getAddressInfo
``` js
// 位置GPS坐标
coordinate = {"latitude": 23.123456, "longitude": 123.123456};
cordova.plugins.gizGeofencing.getAddressInfo(coordinate, func (address) {
// address 地址。地址格式如下。
}, func (errorCode) {
// errorCode 错误码,请参照最后的错误码表。
});
```
```
// 地址格式
{
"FormattedAddressLines": [
"中国广东省广州市天河区沙东街道沙太路陶庄5号"
],
"Street": "沙太路陶庄5号",
"Thoroughfare": "沙太路陶庄5号",
"Name": "沙东轻工业大厦",
"City": "广州市",
"Country": "中国",
"State": "广东省",
"SubLocality": "天河区",
"CountryCode": "CN"
}
```
### 坐标转换
* WGS-84:是国际标准,GPS坐标(Google Earth使用、或者GPS模块)
* GCJ-02:中国坐标偏移标准,Google Map、高德、腾讯使用 (火星坐标系)
* BD-09 :百度坐标偏移标准,Baidu Map使用
1. transformFromWGSToGCJ: WGS-84 转换为 GCJ-02
2. transformFromGCJToWGS: GCJ-02 转换为 WGS-84
3. transformFromGCJToBaidu: GCJ-02 转换为 BD-09
4. transformFromBaiduToGCJ: BD-09 转换为 GCJ-02
``` js
coordinate = {"latitude": 23.123456, "longitude": 123.123456};
cordova.plugins.gizGeofencing.transformFromWGSToGCJ(coordinate, func (targetCoordinate) {
// targetCoordinate 坐标 {"latitude": 23.123456, "longitude": 123.123456}
}, error);
```
## 错误码

@@ -153,2 +220,3 @@

| 4 | 参数不正确 |
| 5 | 定位功能受限 |
| 5 | 定位功能受限 |
| 6 | 位置解析失败 |

@@ -46,1 +46,26 @@ var exec = require('cordova/exec');

};
exports.getCurrentLocation = function (success, error) {
exec(success, error, 'GizGeofenceTool', 'getCurrentLocation', null);
};
exports.getAddressInfo = function (arg0, success, error) {
exec(success, error, 'GizGeofenceTool', 'getAddressInfo', [arg0]);
};
exports.transformFromWGSToGCJ = function (arg0, success, error) {
exec(success, error, 'GizGeofenceTool', 'transformFromWGSToGCJ', [arg0]);
};
exports.transformFromGCJToWGS = function (arg0, success, error) {
exec(success, error, 'GizGeofenceTool', 'transformFromGCJToWGS', [arg0]);
};
exports.transformFromGCJToBaidu = function (arg0, success, error) {
exec(success, error, 'GizGeofenceTool', 'transformFromGCJToBaidu', [arg0]);
};
exports.transformFromBaiduToGCJ = function (arg0, success, error) {
exec(success, error, 'GizGeofenceTool', 'transformFromBaiduToGCJ', [arg0]);
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc