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
Cordovaの問題で困っていますか?
本格的なプロジェクトを構築している場合、トラブルシューティングに時間を費やす余裕はありません。Ionicのエキスパートが、保守、サポート、統合に関する公式サポートを提供しています。
インストール
Ionic Native Enterprise はIonic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる か、エンタープライズプラグインに興味があれば 連絡ください
サポートしているプラットフォーム
- Android
- iOS
利用方法
React
Angular
import { GaoDeLocation } from '@ionic-native/gao-de-location/ngx';
constructor(private gaoDeLocation: GaoDeLocation) { }
const positionOptions: PositionOptions = {
androidOption: {
locationMode: LocationModeEnum.Hight_Accuracy,
gpsFirst: false,
HttpTimeOut: 30000,
interval: 2000,
needAddress: true,
onceLocation: false,
onceLocationLatest: false,
locationProtocol: LocationProtocolEnum.HTTP,
sensorEnable: false,
wifiScan: true,
locationCacheEnable: true
}, iosOption: {
desiredAccuracy: DesiredAccuracyEnum.kCLLocationAccuracyBest,
pausesLocationUpdatesAutomatically: 'YES',
allowsBackgroundLocationUpdates: 'NO',
locationTimeout: 10,
reGeocodeTimeout: 5,
}
};
const positionRes: PositionRes = await this.gaoDeLocation.getCurrentPosition(positionOptions).catch((e: any) => {
console.log(e);
}) || null;
console.log(JSON.stringify(positionRes));
this.gaoDeLocation.startSerialLocation(positionOptions).subscribe((positionRes: PositionRes) => {
console.log(JSON.stringify(positionRes));
});
const positionRes: any = this.gaoDeLocation.stopSerialLocation().catch((e) => {
console.log(e);
}) || null;
console.log(JSON.stringify(positionRes));

