Android studio Can';我不能让电容器地理定位插件在Android Studio中工作
我有一个基于Ionic Vue传单电容器的简单应用程序。在应用程序中,我想获取设备的当前位置。我使用的函数(console.log仅用于调试前)如下所示。我希望函数将纬度和经度传递给此。toLatLng:Android studio Can';我不能让电容器地理定位插件在Android Studio中工作,android-studio,ionic-framework,capacitor,Android Studio,Ionic Framework,Capacitor,我有一个基于Ionic Vue传单电容器的简单应用程序。在应用程序中,我想获取设备的当前位置。我使用的函数(console.log仅用于调试前)如下所示。我希望函数将纬度和经度传递给此。toLatLng: async getCurrentLocation() { // return [51.42373560752357, 6.171726250666831]; console.log("Bankjes: entered GetCurrentLocation&
async getCurrentLocation() {
// return [51.42373560752357, 6.171726250666831];
console.log("Bankjes: entered GetCurrentLocation");
try {
const Position = await Geolocation.getCurrentPosition();
console.log(Position.coords.Latitude);
console.log("Bankjes: ended GetCurrentLocation");
return this.toLatLng(Position.coords.latitude,Position.coords.longitude)
} catch(err) {
console.log("Bankjes " + err);
}
},
当我在Android STudio中使用模拟器调试应用程序时,我在logcat中看到以下内容:
-第一个和第三个console.log fire
-第二个(带Position.coords.lation)没有
知道我做错了什么吗