ios - How to rotate the navigation image according to the user direction in MKMapView? -
i show user's current location while toggling location
mode on free ride
in simulator. it's working fine, take @ image below:
i want image rotate direction of route changes. how can that? here can download project. have not implemented route on below project, changed arrow's direction towards route.
if understand question correctly, want arrow aligned path drawn in map, @ every position on path.
what i'd create cakeyframeanimation
path property set path on map, , rotationmode
set kcaanimationrotateauto
. add animation image view containing arrow.
once you've added animation, set imageview.layer.speed = 0
, control imageview.layer.timeoffset
move arrow. value goes 0 1, , interpolates position on path.
coreanimation automatically rotate view in tangential direction path @ every point.
Comments
Post a Comment