You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/10/10 18:21:51 UTC

[GitHub] [cordova-plugin-geolocation] breautek commented on issue #177: On iOS speed remains still and does not fall to zero

breautek commented on issue #177: On iOS speed remains still and does not fall to zero
URL: https://github.com/apache/cordova-plugin-geolocation/issues/177#issuecomment-540710702
 
 
   iOS geolocation API has a distance filter check, so I suspect when you stop walking, you stop receiving GPS updates (because you're not walking a certain amount of distance anymore) and therefore 
   
   ```javascript
   .subscribe(position => {
   this.currentSpeed = position.coords.speed;
   }
   ```
   
   stops being invoked, with `this.currentSpeed` being the last value it received from the last GPS coordinate you received.
   
   By default, (and hard-coded), the distanceFilter is 5 meters when using high accuracy mode. Below is the code location where the `distanceFilter` is set:
   
   https://github.com/apache/cordova-plugin-geolocation/blob/6570cf9fd2c546620f6aa8b2a07cf0b8b073a95c/src/ios/CDVLocation.m#L140-L151
   
   If you modify this file in your app (search for it within the `platforms/ios/` directory), and change 
   `self.locationManager.distanceFilter = 5;`
   
   to...
   
   `self.locationManager.distanceFilter = 0;`
   
   If it solves you're issue, then perhaps we can look at seeing how we can make the `distanceFilter` configurable.
   
   Also like to be clear that changing code under `platforms/ios/` is not a solution or a workaround as you'll lose your changes the next time you update the ios platform or the plugin. It's just to confirm my suspicion.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org