Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Animated GPS Location Update?

borg359borg359 Posts: 26Registered Users
edited January 2010 in iPhone SDK Development
Hi guys,
I've successfully put together a mapview with a pin annotation representing the users current position that updates at a set interval. When the location manager updates the user's position, the pin annotation disappears and reappears at the new location. Has anyone played with getting the current user's GPS location to update through the use of an animation, like what is done in Apple's offical mapping application? If so, I'd love some pointers to get this to work. Thanks!


-dan
Post edited by borg359 on

Replies

  • JeepstonJeepston Posts: 81Registered Users
    edited January 2010
    Put this in the method where you get updated location

    MKCoordinateRegion region;
        region.center=location.coordinate;
        //Set Zoom level using Span
        MKCoordinateSpan span;
        span.latitudeDelta=.002;
        span.longitudeDelta=.002;
        region.span=span;
        [mapView setRegion:region animated:YES];
    
    iPhone 2G 8Gb 3.1.2 JB, 3G 16Gb 3.1.2 JB, 3GS 16 Gb 3.1.2 JB<br />
    MB5,1 C2D 2GHz 2GB RAM<br />
    Mac OS X 10.5.8
  • borg359borg359 Posts: 26Registered Users
    edited January 2010
    Sorry that I wasn't more specific, I'm trying to get the GPS location annotation to animate, not the map center. I'm trying to replicate the behavior that you see in Apple's mapping program, where the blue GPS annotation smoothly moves when the location is updated.

    I think this can be done by manually adding the GPS icon as an image subview and moving it using a Quartz animation, but I was hoping there was an easier way of doing this that I've overlooked.
Sign In or Register to comment.