I would like to follow user's blue dot same way Google Maps do it. It means when the location is changing then the map (or it's center) should smoothly follow it. But when I use standard way with delegate:
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
[map setCenterCoordinate:map.userLocation.coordinate animated:YES];
}
or keyvalue observer on mapview.userLocation
then move of the map is quite "choppy", it quickly "jumps" to new location even if I use animated
parameter.
In addition I think that the blue dot itself doesn't move so smoothly as in native Google Maps app and often jumps to new location instead of moving there.
Thanks for any help.
'hi Jak
I've tried to solve this as well but it looks like MKMapView might be using some fancy stuff between updates to predict the next position and make the movement smoother.
If you look at the way they handle the compass they are doing a lot of filtering as the raw compass data is not terribly steady so they make it really slick and smooth.
Also, notice when tracking you can zoom but not pan. I've failed to replicate this functionality in my app even with scrolling turned off, it still scrolls when you are zooming if you pan your fingers around.
I guess they don't expose everything just to keep ahead of us :) D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With