Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70440

Ionic Cordova Geolocation - picks a wrong location first and later picks the correct location

$
0
0

@vigamage wrote:

I have been working on my very first Geolocation ionic application. My ionic version is 6.2.1 and the cordova version is 9.0.0.

My question is, when I get the current position using geolocation.getCurrentPosition() it shows a strange behavior. When the getCurrentPosition is invoked for the first time, it usually picks a location which is like 2 km away from my actual location. However, it tends to pick the correct location in usually 5th or 6th(roughly) attempt.

Why is this?

As a workaround for this, I thought of getting the accuracy value, compare it with a threshold, re-pick the location if the accuracy is not enough. This goes until it picks a good enough location.

Is that a good way to achieve what I need? Or is there any way to fix the error in the first place.

Thank you…!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>