cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: ios: Changed distanceFilter from none to 5 meters, prevents it from spamming the callback even though nothing changed.
Date Fri, 27 Jun 2014 18:23:07 GMT
Repository: cordova-plugin-geolocation
Updated Branches:
  refs/heads/master ae97461f5 -> 6d413ad9d


ios: Changed distanceFilter from none to 5 meters, prevents it from spamming the callback
even though nothing changed.

close #16


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/6d413ad9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/6d413ad9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/6d413ad9

Branch: refs/heads/master
Commit: 6d413ad9dc8770b1c45b089cb10f8f7b474d6501
Parents: ae97461
Author: elbarto132 <johannes.heinemann@gmail.com>
Authored: Mon Apr 7 15:22:12 2014 +0200
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Jun 27 14:22:49 2014 -0400

----------------------------------------------------------------------
 src/ios/CDVLocation.m | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/6d413ad9/src/ios/CDVLocation.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVLocation.m b/src/ios/CDVLocation.m
index d52b03d..3f8679b 100644
--- a/src/ios/CDVLocation.m
+++ b/src/ios/CDVLocation.m
@@ -132,8 +132,9 @@
     __locationStarted = YES;
     if (enableHighAccuracy) {
         __highAccuracyEnabled = YES;
-        // Set to distance filter to "none" - which should be the minimum for best results.
-        self.locationManager.distanceFilter = kCLDistanceFilterNone;
+        // Set distance filter to 5 for a high accuracy. Setting it to "kCLDistanceFilterNone"
could provide a
+        // higher accuracy, but it's also just spamming the callback with useless reports
which drain the battery.
+        self.locationManager.distanceFilter = 5;
         // Set desired accuracy to Best.
         self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
     } else {


Mime
View raw message