Giter Club home page Giter Club logo

amap's Introduction

高德地图定位Android,iOS采用gps定位(该定位为持续定位)

本插件利用高德地图提供的定位功能。 cordova-android >= 7.0.0

申请密钥

请参照:
申请android密钥定位SDK
申请ios密钥定位SDK

安装插件

cordova plugin add cordova-gaode-plugin --variable  ANDROID_API_KEY=your android key --variable  IOS_API_KEY=your ios key
npm i cordova-gaode-plugin --save

js/ionic2、3、4使用方法

// js项目调用
window.GaoDe.getCurrentPosition(successCallback, failedCallback,['start'/'stop']);
// ts项目调用。
(<any>window).GaoDe.getCurrentPosition(successCallback, failedCallback,['start'/'stop']);

(<any>window).GaoDe.getCurrentPosition(data => console.warn(data), msg => console.warn(msg), ["start"]);

获得定位信息,返回JSON格式数据:

{
  accuracy: 水平精度

  adcode: 邮编

  address: 具体地址

  city: 城市

  citycode: 国家编码

  country: 国家

  district: 区域

  latitude: 经度

  longitude: 纬度

  poi: 地址名称

  province: 省

  status: 是否成功

  type: ""
}

amap's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.