Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watchPosition options are not working as expected #295

Open
MelihaDuman opened this issue Jan 10, 2024 · 1 comment
Open

watchPosition options are not working as expected #295

MelihaDuman opened this issue Jan 10, 2024 · 1 comment
Labels
question Further information is requested

Comments

@MelihaDuman
Copy link

I am trying to use watchPosition. I am using Android and I tested with a real device.

   const watchId = Geolocation.watchPosition(
      position => {
        const latitude = position.coords.latitude;
        const longitude = position.coords.longitude;
        setLatitude(latitude);
        setLongitude(longitude);
        setSubscriptionId(watchId);
      },
      error => {
        console.log('Error getting location:', error);
      },
      {distanceFilter: 1, maximumAge: 1000, interval:5000},
    );

Even though I change options and option values position is updated only every 20 second regardless distanceFilter and interval values.

@MelihaDuman MelihaDuman added the question Further information is requested label Jan 10, 2024
@gaspop
Copy link

gaspop commented Jan 20, 2024

I'm not having luck with this function on Android either, feels like I've tried every variation of options. It will get an initial position but it never updates. I ended up updating the position manually with an interval instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants