Comments (5)
I agree on letting your users choose how they want the library to work, not forcing them to make changes to your code if they need higher accuracy than 5m changes. At the least this should be documented.
I also found evidence that distanceFilter has no direct impact on battery life at https://stackoverflow.com/questions/5490707/does-cllocationmanager-distancefilter-do-anything-to-conserve-power
from cordova-plugin-geolocation.
Just posting some relevant information for this feature request.
Currently not configurable but this is already done on iOS.
Note distanceFilter
which I believe is in meters.
cordova-plugin-geolocation/src/ios/CDVLocation.m
Lines 140 to 151 in 6be29f2
As for Android, this plugin uses the webview geolocation implementation, which doesn't have a configurable distance filter as far as I can tell. In order to accomplish this, I think the plugin will to use the android location manager directly instead of relying on the browser implementation.
from cordova-plugin-geolocation.
Thanks for your reply.
How to enable this for iOS, if I set options object to be:
{
distanceFilter: NUMBER
}
Is this the proper way?
**
For Android, when will this be available, is there any roadmap for doing so?
from cordova-plugin-geolocation.
How to enable this for iOS
The plugin has the value hard coded to be 5 meters when high accuracy is enabled, or 10 meters otherwise.
For Android, when will this be available, is there any roadmap for doing so?
Sorry, I'm not the person that can answer that question. Obviously moving from the browser implementation to a custom implementation that uses Android's geolocation APIs directly is a significant change...
from cordova-plugin-geolocation.
For the record, I'm having a quick scan through Android Location documentation and it doesn't look like they have a distance filter concept either. Their battery saving recommendations makes no mention of a distance filter and their API reference seems to lack a distance filter setting. So I'm not sure if this is even possible on Android. Distance filter might be an iOS concept only.
Personally I think the distanceFilter for iOS should be configurable. The defaults can be left as is if not explicitly set by the app. For android, the API/config properties would have to be ignored as Android seems to have a different philosophy on achieving conservative battery status when using geolocation.
from cordova-plugin-geolocation.
Related Issues (20)
- iOS 14: Infinite value in returned location data causes app crash HOT 2
- Geolocation getcurrent position passing 0 (Time out error) HOT 5
- !important Android 12 new approximate location and precise location HOT 4
- IOS 15 Geolocation permission message issue. HOT 12
- iOS 15 - ionic app geolocation permission prompt message showing ionic://localhost HOT 2
- geolocation plugin is throwing an error on location request on electron (windows) platform
- [iOS] Location update are disabled after one kCLErrorLocationUnknown HOT 6
- Ionic - Position error:application does not have sufficient geolocation permission HOT 2
- GeoLocation permissions not being asked [SOLUTION] HOT 1
- [iOS permission bug] wrong logic in didChangeAuthorizationStatus hook, permission can be asked in some unexpected cases HOT 10
- [question android api 31 32] approximate access to geolocation for getCurrentLocation HOT 6
- Unable to fetch Location on VIVO Devices HOT 70
- iOS 16 CDVLocation.m throwing UI unresponsiveness warning in XCode - causing app to crash. HOT 7
- Next version release HOT 2
- Description String override in android as in iOS HOT 4
- this.geolocation.clearWatch is not a function HOT 1
- Android 33 issue when initializing HOT 3
- Geolocation working on android 13,14 even 8 but not on android 12 function does not call no error in console HOT 11
- Heading is set to NaN if speed is 0 or null. HOT 1
- Infinite loop onPause() -> onResume() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-geolocation.