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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:42:59+00:00 2026-06-09T00:42:59+00:00

Right now I am populating a map view with annotations, and also displaying the

  • 0

Right now I am populating a map view with annotations, and also displaying the user’s current location. With the viewForAnnotation method, it overrides all annotations with the default red pin, but I want to return the views for the other annotations, but keep the user location the default blue beacon. Is there a way to do this simply or do I have to create a new annotation view and return the right one depending on the annotation?

Right now I have something like:

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
    if (annotation.coordinate == locationManager.location.coordinate) {

return nil;

    }else {

    MKAnnotationView *annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"Beacon"];

    // Button
    UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
    button.frame = CGRectMake(0, 0, 23, 23);
    annotationView.rightCalloutAccessoryView = button;


    annotationView.canShowCallout = YES;

    return annotationView;
}
}

But I can’t equate the two because I can’t get the coordinate property out of the annotation argument.

Anybody know any solutions to this?

  • 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-09T00:43:00+00:00Added an answer on June 9, 2026 at 12:43 am

    Check out the documentation here:

    http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapViewDelegate_Protocol/MKMapViewDelegate/MKMapViewDelegate.html

    As it states:

    If the object in the annotation parameter is an instance of the
    MKUserLocation class, you can provide a custom view to denote the
    user’s location. To display the user’s location using the default
    system view, return nil.

    You can check for it like so:

    if([annotation isKindOfClass: [MKUserLocation class]]) {
      return nil;
    }
    

    Swift:

    guard annotation as? MKUserLocation == nil else { return nil }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I'm populating/setDefaults a zend_form like this from the controller: $data = array('user'
Right now, the label for my Activity has the name of the current Activity.
Right now I have 3 tables: User, Roles, and User_Roles for the many-to-many association.
As it stands right now, I have a TableLayout that I am populating based
I've got two ListBox's with objects as an ItemsSource populating them. Right now, I'm
Right now I'm populating a UIScrollView with a series of views. The views need
Right now I am populating a dropdown div of an input with data on
Right now, I keep all of my projects on my laptop. I'm thinking that
I have a very basic question about populating listviews in android. Right now, if
Right now I have an upload field while uploads files to the server. 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.