Questions tagged [mkannotationview]

MKAnnotationView is part of Apple's Map Kit framework for developing iOS applications, an object that represents annotations visually in a map view.

Annotation views are loosely coupled to a corresponding annotation object, which is an object that corresponds to the MKAnnotation protocol. When an annotation’s coordinate point is in the visible region, asks its delegate to provide a corresponding annotation view. Alternatively (and simpler in many cases), you can simply register an particular annotation view with a particular identifier (notably the MKMapViewDefaultAnnotationViewReuseIdentifier and MKMapViewDefaultClusterAnnotationViewReuseIdentifier identifiers). Annotation views may be recycled later and put into a reuse queue that is maintained by the map view

Annotation views remain anchored to the map at the point specified by their associated annotation object. Although they scroll with the map contents, annotation views reside in a separate display layer and are not scaled when the size of the visible map region changes.

You can use the MKAnnotationView class as-is, use an existing subclass (such as MKMarkerAnnotationView), or subclass it yourself to provide custom behavior as needed. The image property of the class lets you set the appearance of the annotation view without subclassing directly.

See also

986 questions
-1
votes
1 answer

MapKit Looking For More Annotations Than I've Specified

I have an app that calls addAnnotation exactly 3 times (after verifying that the coordinates are good using CLLocationCoordinate2DIsValid, passing a model that responds to id, title latitude, longitude and coordinate. In the model, I watch the…
Steve Ross
  • 4,134
  • 1
  • 28
  • 40
-1
votes
2 answers

Custom MKAnnotaionView, Display title/subtitle Position on Map

1) My annotation shows the title and subtitle of not. I have already tried a lot, but I can not. 2) If an annotation has been selected, the annotation will be centered in the middle of the window. So the map is moved. Any idea? 3) My Callout button…
iAn
  • 3
  • 3
-1
votes
1 answer

MKMapView NSUnknownKeyException

Maybe this question is already asked, but i couldnt find it. The error i get is really giving me a headache! Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this…
Paul Oostenrijk
  • 659
  • 8
  • 16
-1
votes
1 answer

How to Increase height of annotation Title and subTitle area?

Possible Duplicate: How to add more details in MKAnnotation in iOS Any buddies knows how to increase height of annotation title and subtitle field in mkannotation view.
R_RKumawat
  • 133
  • 15
-2
votes
1 answer

viewForAnnotation not called in iPhone 4 but works in simulator

So I am having the strangest problem and I have gone to every where it seem. What I am having an issue with is that I create custom annotation views for my MKMapView.This MKMapView starts with no annotations and as you change the region then…
Tony
  • 4,609
  • 2
  • 22
  • 32
-2
votes
1 answer

User select one annotation on MapKit

I do a app with MapKit and I want the user can select an annotation (clic on) and then open a new view controller. I do it with the method : func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) { performSegue(withIdentifier:…
CocoBalt
  • 1
  • 1
-2
votes
1 answer

can UIimage have text or string at xcode?

I was building an application, an example I have MapView that will show many annView, the question is How can I make it all different, with a little subtitle, such as number or something like symbol can UIImage do that? I want to make something like…
user4951
  • 32,206
  • 53
  • 172
  • 282
-2
votes
1 answer

How to Switch between Clustered and Non Clustered Annotations in Apple Map IOS

So My requirement is pretty straight forward . i Have a switch on map which will allow the users to select the style in which the map annotations should look like 1 . Clustered annotations ( apples default clustering when annotations collide) 2 .…
ManuRaphy
  • 361
  • 1
  • 13
-2
votes
1 answer

Map annotation swapping from displaying image to default pin randomly

When the map is tested through simulator I notice that some annotations display the default pin instead of the customized image. When I go back to the apps Home menu and enter the mapview again the same thing happens with different annotations.…
Ben
  • 91
  • 1
  • 6
-3
votes
1 answer

Change a custom MKAnnotationView when it is selected

I have a MKMapView with several different types of MKAnnotationViews on it. Chiefly, I have a PricedAnnotationView, which is a fairly complicated MKAnnotationView with a UILabel and some other views. The label can have different text in it, based…
Erik Allen
  • 1,841
  • 2
  • 20
  • 36
-3
votes
1 answer

How do I add a custom annotation to a map view with images in Swift 2?

I have created an MKMapView, but I need to add multiple annotations with images in Swift 2, how would I do this?
1 2 3
65
66