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

  • Home
  • SEARCH
  • 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 8511577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:02:15+00:00 2026-06-11T04:02:15+00:00

I am working on a map application. I am done with fetching locations on

  • 0

I am working on a map application. I am done with fetching locations on certain conditions, showing annotation on map view and displaying my custom callout bubble.

My requirement is to display the annotation pin as follow:

  • A Image with rounded corner to display annotation
  • On the right top corner of the annotation there will be a red badge kind of view.
  • Need to access that red badge view and set text in certain methods.

Now I know I can set Image to the annotation view and make it rounded corner as follow:

pinView.image = [UIImage imageNamed:@"annotationImage"];
[pinView.layer setCornerRadius:8.0];
[pinView setClipsToBounds:YES];

Here pinView is an AnnotationView.

Please let me know if I can create a custom view and assign it to pin view so I can get the red badge and set Image as well.

UPDATE

I tried lot more things and got succeed to put the view. But the problem is if I use a MKAnnotationView object on map I am not able to tap it or call gesture recognizer on it. If I use MKPinAnnotationView than I am able to call didSelected method or add a gesture recognizer but I am not able to set a Image on it as it is a Pin Annotation.
Plz let me know if this is possible.

Thanks in advance.

  • 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-11T04:02:17+00:00Added an answer on June 11, 2026 at 4:02 am

    you need to set your Class as MKMapViewDelegate and fill this method:

    - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
     CustomMapAnnotationView *annotationView = nil;
    
     pinView.image = [UIImage imageNamed:@"annotationImage"];
     [pinView.layer setCornerRadius:8.0];
     [pinView setClipsToBounds:YES];
    
     NSString* identifier = @"CustomMapAnnotation";
     CustomMapAnnotationView *newAnnotationView = (CustomMapAnnotationView *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
    
     if(nil == newAnnotationView) {
        newAnnotationView = [[[CustomMapAnnotationView alloc] initWithAnnotation: pinView reuseIdentifier:identifier] autorelease];
     }
    
     annotationView = newAnnotationView;
     [annotationView setEnabled:YES];
     [annotationView setCanShowCallout:YES];
    
     return annotationView;
    }
    

    Thus, you can return a custom Class, subclass of MKAnnotationView, and you can add badge now to your custom view.

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

Sidebar

Related Questions

i am displaying some locations using Google map in my application, and displaying all
I am working on a GPS data logger and Map viewer application using Microsoft
I am working on an Android application that shows a map with the user's
I'm working on a multi-threaded win32 MFC application. We are rendering a map and
i working on map view. i want to put overlay item on the map
I am working on the map application and as per requirement i need to
I am working on a map application in iPhone. While loading the MapViewController the
i am working on a map application, in that i like to drop the
I am working on a sample map application using Flex 4/fxg? Now I have
I'm working on an advanced map application in Google Maps API V3. I'm using

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.