Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6616095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:32:29+00:00 2026-05-25T20:32:29+00:00

In my application I have a MKMapView where several annotations are shown. The map

  • 0

In my application I have a MKMapView where several annotations are shown. The map rotates based on the heading of the device. To rotate the map the following statement is performed (called by the method locationManager: didUpdateHeading:)

self.navigationMapView.mapView.transform = CGAffineTransformMakeRotation(-heading);

where the heading (magnetic) is expressed in radians. What I noticed it’s that even the annotations in the map rotate and I don’t want it. I tried to fix it in the following method:

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{

    static NSString *identifier = @"AnnotationViewIdentifier";

    MKAnnotationView *av = [mapView dequeueReusableAnnotationViewWithIdentifier:identifier];

    if (av == nil) {
        av = [[[MKPinAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:identifier] autorelease];
    }
    else{
        av.annotation = annotation;
    }

    av.transform = CGAffineTransformMakeRotation(degreesToRadians(self.arController.currentHeading.magneticHeading)); 

    av.canShowCallout = YES;
    return av;

} 

and I want to call this method from “didUpdateHeading:” but I really don’t know how to do it. The TableView class has the reloadData function that calls the delegate method but here the things seem different. Any suggestions?!

Another question, my annotations on the map show the distance from the user, I would like to update them (distance label) as soon as the user change location. Any suggestions?!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:32:30+00:00Added an answer on May 25, 2026 at 8:32 pm

    So with a MKMapView having that be called properly is a little bit annoying. Essentially you have one of two options. Option 1: Create an array of the annotation on the screen and remove that from the map_view and then re-add them to the map_view. Essentially creating your own reload data function. Option 2: Do something simple such as

    CGLocationCoordinate2D coordinate = map_view.center;
     map_view.center = coordinate;
    

    — Essentially the point is to reset a property of the map causing it to redraw. However this option is not always going to work. Option 1 has a higher chance of working however that one can also fail, so if simply taking the annotations off and re-adding them causes nothing to happen then simply decreate the map and then recreate the map at the end of your map refresh function something like.

    [my_map_view removeFromSuperView];
    [my_map_view release];
    my_map_view = nil;
    my_map_view = [[MKMapView alloc] initWithFrame:CGRectMake(0,0,320,480)];
    

    one of these options should work. I had to do option one for my solution however I know some people are lucky and option 2 works just as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm developing an application for iPad. I have a mapview with several annotations. I
I am creating an application which displays map using MKMapView control. I have a
I have an application with map and want to zoom to the current location,
I have an application that uses the mapview-overlay-manager code to draw map markers on
In my iPhone application I have used MKMapView to navigate from different pages. But
I am developing an android application in I have two GeoPoints in Google map.One
I have several memory leaks when testing my IOS application in xcode instruments. Can
I have an application that uses MKMapView and at some point in the app
In my android application i have used the google map. I have using android
I have a IPad application in which I add MKMapView programmatically without using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.