Closed gine closed 2 years ago
It looks like it may be possible to set the CLLocationManager#distanceFilter
property on the fly on iOS, but not on Android. This is because the setSmallestDisplacement
method is on the LocationRequest
, which is no longer mutable once submitted.
I would recommend you simply remove and add watchers in response to changes in speed. I would be surprised if this strategy caused any negative impact on accuracy.
- permitting to pass to distance filter a function that must return a number
Please also note that as Capacitor plugin methods can only take listener functions as parameters, this would not be possible.
Can be really useful a function to set the distance filter. I need to set it using the speed parameter:
More speed = mode distance filter less speed = less distance filter
You can do it in 2 ways:
1) permitting to pass to distance filter a function that must return a number 2) an external function setDistanceFilter to set the parameter when user need to do it