Gao De Location
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
- 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
- Add this plugin to your app's module
Supported platforms
- Android
- iOS
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>