Navigator.geolocation.getCurrentPosition in a cord gives only 10 meters accuracy

navigator.geolocation.getCurrentPosition in cordova / android gives a maximum accuracy of 10 meters. I did not use the plugin for geolocation. But some other applications show 3-meter accuracy for the same place.

navigator.geolocation.getCurrentPosition will not give better accuracy?

+5
source share
1 answer

Unfortunately, cordova-plugin-geolocation for Android does not provide any native code, just minimal code handles permissions for Android 6+. It uses the WebView geolocation implementation to get the location, so if you use enableHighAccuracy: true , you wonโ€™t get the expected accuracy, you canโ€™t do anything about it (perhaps complain about Google to improve it in future updates of System WebView) Results are likely will be different from vendor / Android versions.

So, if you need higher accuracy, you should look for another plugin that uses native code to get the location instead of using the one that WebView provides. There are several of them, it is better to look for "background geolocation", since those that provide background geolocation use their own code.

+4
source

Source: https://habr.com/ru/post/1275512/


All Articles