Toggle navigation
Toggle navigation
This project
Loading...
Sign in
尹诚
/
Mapbox-iOS-SDK
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Justin R. Miller
12 years ago
Commit
ed5bda96fc768f42e296021d01d1d4446722bf6f
1 parent
d83eb3d5
fixes #27: bouncing accuracy circle on first location update
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
MapView/Map/RMMapView.m
MapView/Map/RMMapView.m
View file @
ed5bda9
...
...
@@ -3303,6 +3303,30 @@
[
self
addAnnotation
:
_accuracyCircleAnnotation
];
}
if
(
!
oldLocation
)
{
// make accuracy circle bounce until we get our second update
//
[
CATransaction
begin
];
[
CATransaction
setAnimationDuration
:
0
.
75
];
[
CATransaction
setAnimationTimingFunction
:[
CAMediaTimingFunction
functionWithName
:
kCAMediaTimingFunctionEaseInEaseOut
]];
CABasicAnimation
*
bounceAnimation
=
[
CABasicAnimation
animationWithKeyPath
:
@"transform"
];
bounceAnimation
.
repeatCount
=
MAXFLOAT
;
bounceAnimation
.
fromValue
=
[
NSValue
valueWithCATransform3D
:
CATransform3DMakeScale
(
1
.
2
,
1
.
2
,
1
.
0
)];
bounceAnimation
.
toValue
=
[
NSValue
valueWithCATransform3D
:
CATransform3DMakeScale
(
0
.
8
,
0
.
8
,
1
.
0
)];
bounceAnimation
.
removedOnCompletion
=
NO
;
bounceAnimation
.
autoreverses
=
YES
;
[
_accuracyCircleAnnotation
.
layer
addAnimation
:
bounceAnimation
forKey
:
@"animateScale"
];
[
CATransaction
commit
];
}
else
{
[
_accuracyCircleAnnotation
.
layer
removeAnimationForKey
:
@"animateScale"
];
}
if
([
newLocation
distanceFromLocation
:
oldLocation
])
_accuracyCircleAnnotation
.
coordinate
=
newLocation
.
coordinate
;
...
...
Please
register
or
login
to post a comment