New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-amap-location

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-amap-location

> 支持ios, android 开通服务: [http://lbs.amap.com](http://lbs.amap.com)

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

高德地图定位 cordova 插件

支持ios, android 开通服务: http://lbs.amap.com

安装

cordova plugin add cordova-plugin-amap-location --variable IOS_KEY=你的KEY --variable ANDROID_KEY=你的KEY --save

ionic cordova plugin add cordova-plugin-amap-location --variable IOS_KEY=你的KEY --variable ANDROID_KEY=你的KEY

相关依赖 cordova-plugin-cocoapod-support

cordova plugin add cordova-plugin-cocoapod-support --save

ionic cordova plugin add cordova-plugin-cocoapod-support

使用方法

配置

var config = {
  // ios配置
  locationTimeout: 10, // 定位Timeout(s)
  reGeocodeTimeout: 10, // 地址信息Timeout(s)
  iosAccuracy: 1000, // 精确度(m)
  distanceFilter: 10, // 连续定位最小位移(m)
  watchWithReGeocode: false, // 连续定位是否返回地址信息
  iosBackground: true, // 后台定位

  // android配置
  interval: 2000, // 连续定位时间间隔(ms)
  androidAccuracy: 1, // 精确度 0. Battery_Saving 1. Hight_Accuracy, 2. Device_Sensors
  needAddress: true // 是否返回地址信息

}

单次定位

window.AmapLocation.getCurrentPosition(
  config
  ,
  x => {
    console.log(x);
  },
  e => console.error(e)
);

连续定位

window.AmapLocation.watchPosition(
  config
  ,
  x => {
    console.log(x);
  },
  e => console.error(e)
);

清除连续定位

window.AmapLocation.clearWatch(
  x => {
    console.log(x);
  },
  e => console.error(e)
);

FAQs

Package last updated on 03 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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