Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cordova-plugin-background-geolocation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Aksimaya
cordova-plugin-background-geolocation
Commits
cff6468f
Commit
cff6468f
authored
Feb 11, 2014
by
Chris Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up distance-filter calculator
parent
d2cfb3b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
CDVBackgroundGeoLocation.m
src/ios/CDVBackgroundGeoLocation.m
+7
-9
No files found.
src/ios/CDVBackgroundGeoLocation.m
View file @
cff6468f
...
...
@@ -290,14 +290,7 @@
// Adjust distanceFilter incrementally based upon current velocity
if
(
isMoving
)
{
float
newDistanceFilter
=
distanceFilter
;
// sanity-check obvious high speed error.
if
(
newLocation
.
speed
>
100
)
{
return
;
}
if
(
newLocation
.
speed
>
5
.
0
)
{
newDistanceFilter
=
[
self
calculateDistanceFilter
:
newLocation
.
speed
];
}
float
newDistanceFilter
=
[
self
calculateDistanceFilter
:
newLocation
.
speed
];
if
(
newDistanceFilter
!=
locationManager
.
distanceFilter
)
{
NSLog
(
@"- CDVBackgroundGeoLocation updated distanceFilter, new: %f, old: %f"
,
newDistanceFilter
,
locationManager
.
distanceFilter
);
[
locationManager
stopUpdatingLocation
];
...
...
@@ -367,7 +360,12 @@
*/
-
(
float
)
calculateDistanceFilter
:(
float
)
velocity
{
return
(
5
.
0
*
floorf
(
velocity
/
5
.
0
+
0
.
5
f
))
*
10
;
float
newDistanceFilter
=
distanceFilter
;
if
(
velocity
>
5
.
0
&&
velocity
<
100
)
{
newDistanceFilter
=
(
5
.
0
*
floorf
(
velocity
/
5
.
0
+
0
.
5
f
))
*
10
;
}
return
newDistanceFilter
;
}
-
(
void
)
stopBackgroundTask
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment