-
-
Notifications
You must be signed in to change notification settings - Fork 77
Different Location Accuracy Result on Google Map and NativeScript Geolocator On Same Mobile Device #100
Comments
@oduwareosahon I've tried to reproduce the issue using this test application but to no avail. |
You can replicate this issue by testing the following on a physical android device: (2) Open Google Map Android App on the same physical device (install it if not installed). The blue marker should indicate your current location. (3) Compare the location displayed on a map in Step 1 with that of Step 2. You should notice that the location on the Google Map App (Step 2) is very accurate, while the location obtained from NativeScript Geolocator plugin (Step 1) is very inaccurate (ranges between 500 - 1,500 metres from the actual location). My question is why the difference in accuracy on the same physical device when (according to the documentation) they both use the same Google Play Services. CODE EXTRACT // Function to get the current location
} |
@NickIliev I think I finally have a clue as to what might be the likely cause of the difference in accuracy. I observed the following on my device (Tecno Carmon CX):
When the app sends an enable location request, I get a prompt - "To continue, let your device turn on location, which uses Google's location service...." This selects the first option (High Accuracy) among the 3 options stated above. However, it seems that with this option on my device, the Geolocation plugin isn't using the device GPS to determine the location as expected (the documentation states that it would use the most accurate location provider that is available). When I attempt to change the Settings -> Location -> Mode option to either "Battery Saving" or "Device only", the app keeps giving the initial prompt to turn on location which sets the option back to "High Accuracy". The issue seems to be that with this option, the Geolocation plugin doesn't use the device GPS to determine the location. How? I discovered this to be so by manually changing the Settings -> Location -> Mode option to "Battery Saving" which would use Wi-Fi, Bluetooth, or cellular networks to determine location. With this option, on the Google Map android app the current location marker (blue indicator) is exactly the same as the inaccurate position returned by the Geolocation plugin. However, when I change the option to "Device only" which would use GPS to determine location, the Google Map android app returns an accurate location. Is there a way to ensure that the Geolocation plugin only uses the device GPS to determine the location and returns say a NULL location otherwise OR is there a way to make the Geolocation plugin accept other location options on my device - e.g "Device only"? |
@NickIliev Thanks for your response. Yes, accepting the mode change is successfully changing the Location mode settings to Accuracy High on my device. The issue seems to be that with the "Accuracy High" option, the Geolocation plugin doesn't use the device GPS to determine the location as expected (the documentation states that it would use the most accurate location provider that is available). How? I discovered this to be so by manually changing the Settings -> Location -> Mode option to Battery Saving which would use Wi-Fi, Bluetooth, or cellular networks to determine location. With this option (Battery Saving), on the Google Map android app the current location marker (blue indicator) is exactly the same as the inaccurate position returned by the Geolocation plugin. However, when I change the option to Device only which would use GPS to determine location, the Google Map android app returns an accurate location. |
GPS works better when the device is outside and not in a building. High Accurary/Device only modes will take some time to provide an accurate location (especially from a cold start). Battery saving mode does not use GPS and will usually provide a location faster, although it might not be as accurate. If the timeout you set for the location request is not long enough, you might not get a GPS lock and a correct location in time. Try increasing it and see if it has any effect. In your case, perhaps Google Maps is caching the last known location in some way and using it while the device tries to get a fresh one? |
Closing this issue due to inactivity |
Im having this exact same problem, the Accuracy using the plugin is terrible compared to Google Maps, Maps get my exact location while the plugin get me a 16-90mts accuracy while stationary or walking and 2500mts accuracy while driving. As it seem the plugin is not using my gps for location (Im using desiredAccuracy: Accuracy.high and my location config on Android is on High accuracy too) |
Can confirm the accuracy is also WAY off on iOS too.
Here's the Playground I used. Test method:
Test Device:
I also see no difference between High, and Any accuracy
|
After rolling my own implementations I have found
|
Similar to the issue raised in the following link which has been closed:
#69
I utilized the NativeScript Geolocator plugin (with an Accuracy.high option) to obtain the longitude & latitude of my location on an Android device (version 7.0). The horizontal/vertical accuracy of the location returned was a range of 500 - 1,500 metres.
When I put the location obtained on Google Map (using the required Latitude,Longitude pair), the location is very far from my actual location (corresponding to the horizontal/vertical accuracy).
However, when I use the Google Map mobile app to obtain my current location it is very accurate (as displayed by the blue marker/indicator).
I would have thought that the location provided by the NativeScript Geolocator plugin (using the Accuracy.high option) should be same as that of Google Map mobile app since they use the same Google Play Services.
Could someone help with this.
The text was updated successfully, but these errors were encountered: