0

Geo-location watch only fires every minute. Using a Nexus-5, android 4.4.2, and cordova 3.3.1 (I've also tried 3.4.0). It makes no difference what I define maximumAge as. The location returned is correct. In other devices I have have tested it gets fired every second. I know I can fall back on using setTimeout with getCurrentPosition, but I'd like to understand this behaviour.

navigator.geolocation.watchPosition(
    function(){
        console.log("success");
    },
    function(){
        console.log("fail");
    },
    {
        enableHighAccuracy: true,
        timeout: 30000
    }
);
2
  • Are you using the Geolocation Plugin or just the HTML5 Geolocation API? Because the Geolocation Plugin is not that great, and will actually be deprecated in the next Cordova release. They suggest that you just use the HTML5 Geolocation API. Mar 26, 2014 at 14:43
  • Yes the plugin was enabled, removing it fixes it. If you put your comment as an answer I've give you a big tick!
    – gmh04
    Mar 26, 2014 at 15:04

1 Answer 1

2

The Geolocation Plugin is not that great, and will actually be deprecated in the next Cordova release. They suggest that you just use the HTML5 Geolocation API instead, which uses the same syntax.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.