Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Gao De Location

Improve this doc

Because the original GPS positioning uses Google Browser positioning, and Google withdraws from China, resulting in GPS Android positioning can not be positioned. Gaode location can directly return address informationGaode location can directly return address information

Repo: https://github.com/waliu/cordova-plugin-gaodelocation-chenyu.git

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-gaodelocation-chenyu --variable  ANDROID_API_KEY=your android key --variable  IOS_API_KEY=your ios key
    $ npm install --save @ionic-native/gao-de-location@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { GaoDeLocation } from '@ionic-native/gao-de-location';


constructor(private gaoDeLocation: GaoDeLocation) { }

this.gaoDeLocation.getCurrentPosition()
.then((res: PositionOptions) => console.log(res))
.catch((error) => console.error(error));

Instance Members

getCurrentPosition()

Get longitude and latitude, country, province, city, postal code, specific address, region

Returns: Promise<PositionOptions>

API

Native

General