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 8934233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:44:19+00:00 2026-06-15T09:44:19+00:00

As i want to implement the custom call out in the mkmapview i am

  • 0

As i want to implement the custom call out in the mkmapview i am using these classes CalloutMapAnnotationView.h and CalloutMapAnnotationView.m

I have extracted these classes from the following links

https://github.com/asalom/Custom-Map-Annotation-Callouts/blob/master/Classes/CalloutMapAnnotationView.h

https://github.com/asalom/Custom-Map-Annotation-Callouts/blob/master/Classes/CalloutMapAnnotationView.m

These work fine in ios5 but in ios6 when i am clicking on the call out the map view is moving and call out is not showing correctly as shown in the below figures while i was zooming also its not coming correctly i have tried several ways to get rid out of this problem by checking the version of os and tried to change the some of the methods in the classes but of not use.

After implementing these in ios5 map view coming like this
enter image description here

In Ios6 This one not coming properly as like in ios5. for example
enter image description here

  • 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-06-15T09:44:20+00:00Added an answer on June 15, 2026 at 9:44 am

    I too have faced the same problem in iOS 6 using these classes. These changes worked for me:

    1) Change in this method:

    This method you will implement in your map view class

    (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView*)view
    

    as following order of lines

    self.selectedAnnotationView = view;
    
    [self.mapView addAnnotation:self.calloutAnnotation];
    

    2) In CalloutMapAnnotationView.m file

    - (void)adjustMapRegionIfNeeded in this method first 5 lines like bellow
    
        CGFloat xPixelShift = 0;
    
       if ([self relativeParentXPosition] < 38) {
    
            xPixelShift = 38 - [self relativeParentXPosition];
    
       } else if ([self relativeParentXPosition] > self.frame.size.width - 38) {
    
      xPixelShift = (self.frame.size.width - 38) - [self relativeParentXPosition];
    
       }
    

    3) In same class CalloutMapAnnotationView.m – (void)drawRect:(CGRect)rect in this method afterCGFloat parentX = [self relativeParentXPosition];

    line and above rect = self.bounds; this line
    add following lines

        if ([self relativeParentXPosition] < 38) {
    
           parentX = 38;
    
       } else if ([self relativeParentXPosition] > self.mapView.frame.size.width - 38) {
    
           parentX = [self relativeParentXPosition]-25;
    
       }
    

    4) In same class CalloutMapAnnotationView.m.

    - (void)didMoveToSuperview {
            [super didMoveToSuperview];
            [self.superview bringSubviewToFront:self];
        }
    

    You can use directly the above classes and use them they work fine in both iOS 5 & iOS 6.
    You should make necessary changes according to your requirements.

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

Sidebar

Related Questions

I got an assignment where I have to implement a custom call forwarding system
I want to implement a custom trace listener like follows: public class TraceListener :
I want to implement setSingleChoiceItems inside a custom Dialog but unable to do it.
I want to implement a method that will find stuff in my custom class.
im trying to implement a custom error page, what i want to be able
i starter in jqgrid, i want implement inline edit in jqgrid i have this
I want to implement the Google custom search API with Greasemonkey, and so far
I have a custom object that implements INotifyPropertyChanged. I have a collection of these
I'm using Rails and want to implement FlipCounter. Here is link to documentation -
I'm developing an ASP.NET MVC 3 project and I want to implement my custom

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.