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
0
votes
1 answer

MKAnnotationView Customize callout - handle touch on a button

I'm using the J4n0 Callout code (github), to implement a custom annotation in MapKit. In my annotation (MyCalloutView) I'm using a button and a label. When I'm clicking on my button, the methode handleTouch is called, but the sender correspond an…
Thomas Besnehard
  • 2,106
  • 3
  • 25
  • 47
0
votes
1 answer

Change MKAnnotationView programmatically

Is there a way to change MKAnnotationView style (like from red label with number to green colored label with number). I want to change this style according to distance from target. My annotation is moving, with user. I dont want to use remove / add…
Martin Perry
  • 9,232
  • 8
  • 46
  • 114
0
votes
2 answers

Open map annotation on table row click? on Titanium

I am new to Titanium and in the process of making my first iOS app using Titanium but I've hit a wall with a use case. I am trying to open an annotation on the map by clicking on a particular row on a table view. I haven't had much success with this…
ares05
  • 177
  • 4
  • 9
0
votes
1 answer

Wrong annotation views being displayed on the map

I am inserting a new kind of annotations and, differently from the previous ones, they behave crazily. When the map of an area is shown, the delegate is passed annotation belonging to a far away zone, reporting their own features. Yet they appear…
0
votes
0 answers

difference between viewForAnnotation and addAnnotation

I realize that they have different return values.. I suppose I'm asking because I'm trying to "refresh" an annotation's associated view. Here's the process: I select an annotation and then, via an action sheet, change a property on the annotation,…
ari gold
  • 2,074
  • 3
  • 25
  • 51
0
votes
0 answers

Customizing mapView:viewForAnnotation generate an infinite loop

first question form me. I'm trying to customize the default blue circle for the user position, but when I redefine the method mapView:viewForAnnotation I, in some way, generate an infinite loop: The redefined method: - (MKAnnotationView…
Lucabro
  • 525
  • 3
  • 9
  • 30
0
votes
1 answer

Using MKMapViewDelegate

I can't understand why it's not working. I have a map with a marker, I would like to change the icon map.h: #define METERS_PER_MILE 1609.344 @interface Map : UIViewController{ IBOutlet MKMapView…
user1256477
  • 10,763
  • 7
  • 38
  • 62
0
votes
1 answer

MKMapKit get visible annotationviews

How can I get all the visible MKAnnotationViews in - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)clickedview Basically I want to make some calculation to get all the views touching (in cascade) the…
Mathieu
  • 1,175
  • 4
  • 19
  • 34
0
votes
1 answer

How implement the subtitle's update in mkannotationview after the tap on the corresponding annnotationview

Just like the googlemap's implementation.After a tap on the annotation view ,callout bubble will show ,and then acquire the network to get some information .After we got it ,we need to update the annotationview's subtitle. How to implement this…
chenakira
  • 131
  • 1
  • 10
0
votes
3 answers

put image in mapView annotation

Suppose I have an image saved on the iPhone, and a class I called MKAnnotationDelegate that implements the MKAnnotation protocol. I can display annotations on an map view using that class, but can't figure out how to set a callout acccessory and put…
user1542660
  • 1,299
  • 2
  • 9
  • 8
0
votes
1 answer

MKAnnotationView

I use this code for create my custom annotation view. - (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id )annotation { MKPinAnnotationView *pinAnnotation = nil; if(annotation != myMapView.userLocation) { …
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
0
votes
2 answers

MKMapView MKAnnotationView ISSUE?

I have a map view with pins that when the user selects a pin it goes to a detail screen for that pin. I also have a table view that when the user selects an item it goes to the same type detail view. I am adding the multiple pins in mapview through…
roamingsoul
  • 93
  • 2
  • 12
0
votes
1 answer

Changing an image in MKMapKit MKAnnotation Subclass

I am having some problems with changing an image view inside of an MKAnnotationView subclass. I have a timer that updates the annotation position based on data about where a user was at a certain point. This works fine and the annotation position is…
Chris Grant
  • 2,463
  • 23
  • 27
0
votes
1 answer

MKAnnotationView Callout View doesn't appear

So I have MKAnnotationViews on the map in my app, however, I cannot seem to get the annotation to show a callout. Heres some of the code I've tried: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id )annotation…
Andrew
  • 3,874
  • 5
  • 39
  • 67
0
votes
2 answers

Custom Map View

Here is the scenario... I have a image of a map in jpeg format... I want to add it to my iPhone application and mark the coordinates in certain places (just like annotation in map kit ) and also when i move from one place to another place the…