Questions tagged [mapkitannotation]

MKAnnotation is the protocol that annotation objects must implement in order to be rendered on apple maps. The only absolute requirement is to provide a coordinate attribute. This is a CLLocationCoordinate2D object containing the latitude and longitude of your annotation.

The application obtains the data from a resource. This could be Core Data, a ReST call or any other suitable source. It is recommended that this be done on a background thread to not impact UI performance.

This data is then used to instantiate MKAnnotation objects. In addition to the required CLLocationCoordinate2D attribute a title can be supplied to display underneath the map pin. A subtitle will be displayed when the user selects the pin.

Annotations can be added individually or as an array to a MKMapView. The map will call its viewFor delegate when it is time to render the annotation. The application should attempt to dequeue an annotation view and if one is not available it should create a new one. This is the same paradigm used for table rows.

Finally assign the annotation to the AnnotationView. Additional options exist in MKMarkerAnnotationView to further customize e.g. changing the color of the marker pin.

Related tags:

References:

MKAnnotation

256 questions
0
votes
1 answer

Drag/Drop annotation in map kit not working as expected

I am trying to implement drag/drop annotation on map. Initially the pin is dropped at user's current location which i do with [self.mapView setShowsUserLocation:YES]; but when i drag and drop the pin it returns back to the current location after…
Assassin
  • 215
  • 1
  • 4
  • 13
0
votes
1 answer

viewForAnnotation not being called (using Alamofire to parse JSON)

I'm new to iOS programming. I prefer to use Swift. What I'm trying to do is call a web service that returns some JSON, parse the JSON into a custom object called Entry and plot those entries on a map. I am using AlamoFire to make the web service…
Arthur Garza
  • 2,031
  • 2
  • 14
  • 17
0
votes
1 answer

Safari Search From Any Given Point Annotation in MapView

Alright, I'm going to do my very best at explaining this. The method "searchBarSearchButtonClicked:" accesses a singleton pattern from the data source which provides an MKLocalSearch. We then set up the point annotations in our MapViewController…
Alex Blair
  • 584
  • 1
  • 4
  • 19
0
votes
0 answers

How pass data from Mapkit to viewcontroller

I want to pass the data (quelmonument) from a pinpoint on a Mapkit to another viewcontroller. With this code just below, i could get the good value but i don't know i could do to pass the data. func mapView(mapView: MKMapView!, annotationView:…
Hugo75
  • 249
  • 3
  • 15
0
votes
1 answer

Make a segue from map view when annotation is clicked

I am having trouble creating a segue from my Map view to another View Controller. I want the user to click an annotation and have another view controller pop up. I am having trouble creating the segue between the annotation press and the next view…
applejuiceteaching
  • 1,473
  • 3
  • 13
  • 25
0
votes
1 answer

Adding a button to MKPointAnnotation?

I just wrote few lines of code and got stuck trying add a detail button to my annotation point, I don't know how. Does anyone know how to do that? The image below shows what I want to achieve. Thanks! https://i.stack.imgur.com/kK1Ox.jpg Im trying…
emaadali
  • 11
  • 3
0
votes
1 answer

MKPointAnnotation show image in label

Can you help me with MKPointAnnotation? I would like to replace the annotation text with an image. For example, "1094_00_m.jpg" should display the image that corresponds with the filename rather than the filename. The image thumbnail will appear in…
0
votes
1 answer

Adding a custom annotation to a MKMapview

I am trying to add annotations to a MKMapView I have created a class CustomMapPin which conforms to the MKAnnotation protocol #import #import @interface CustomMapPin : NSObject { …
Ashish Agarwal
  • 14,555
  • 31
  • 86
  • 125
0
votes
0 answers

Creating Unique Properties for each instance on Custom Annotation

So I am making an app that has an app that makes multiple map annotations using the same custom class. Each annotation currently has a button on it. What I want to do is to have each pin assign a unique value to a variable in the main view…
woakley5
  • 304
  • 3
  • 17
0
votes
1 answer

Apple MapKit with Kingpin annotations clustering custom annotations

I have built a Map application that uses the Kingpin map pin clustering library, (found here) at present the library succeeds in approximating the position of the pins and placing the cluster pin. However, the original pins are never removed as seen…
user3192649
  • 313
  • 1
  • 4
  • 13
0
votes
1 answer

iOS: show json info on detailView when click on annotation

I have a json file with some information I want to show this information on map, I can show Long and Lat on map, when you click on Annotation I have a button I want to show detail of my json on detail view, my problem is that I donot know how to…
Sara Shumika
  • 81
  • 1
  • 8
0
votes
1 answer

Map not showing annotation

I am including an annotation to a mapView, but it is not shown. The map appears and it is centered at the expected location. The map center coordinates are the same as the annotation coordinates. Any help to detect where is the problem is…
mvasco
  • 4,965
  • 7
  • 59
  • 120
0
votes
1 answer

Blank ViewController after calloutAccessoryControlTapped

I have a MKMapView and some markers on the map. When user taps a marker an MKAnnotationView comes up with a title and a button of type UIButtonTypeDetailDisclosure. When the user taps the button it should go to another viewController. The problem…
hoya21
  • 893
  • 7
  • 24
0
votes
0 answers

UIImagePickerController from Mapkit Annotation?

I have a project where I load custom annotations from an SQLLite db into MapKit and a right call out that sends an email. What I'd like to achieve is to be able to present the user with a Image Picker (Camera or Camera Roll) by pressing the Info…
Timmytatw
  • 37
  • 4
0
votes
1 answer

MKMAPKITANNOTATION information into a detail viewController by category?

I have a map that has multiple annotations that are plotted on the map sourced from JSON data that are broken up by category within a UITableViewController that contains information like their latitude and longitude as well as other information…
Lalalalalala
  • 167
  • 1
  • 1
  • 10