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
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Animated GPS Location Update?

borg359borg359 Posts: 26Registered Users
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
    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

    MB5,1 C2D 2GHz 2GB RAM

    Mac OS X 10.5.8
  • borg359borg359 Posts: 26Registered Users
    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.