Questions tagged [mkpointannotation]

MKPointAnnotation is a specific part of Apple's general MapKit system.

Apple's MapKit system in iOS generally allows developers to show real-world maps, GPS directions, and so on inside a UIView.

MKPointAnnotations are the small "speech bubble-like" annotations, which you can add to a MKMapItem, shown on a MapKit map.

99 questions
30
votes
2 answers

Swift different images for Annotation

I managed to get a custom icon for a annotation pin in Swift, but now I am still stuck using 2 different images for different annotations. Right now a button adds a annotation to the map. There should be another button that also adds a annotation…
Fabian Boulegue
  • 6,476
  • 14
  • 47
  • 72
25
votes
7 answers

iOS : Swift - How to add pinpoint to map on touch and get detailed address of that location?

I want to add annotation on touch of iOS map and fetch the detailed address (Placemark) of respective location. How I can achieve this in Swift? Thanks in advance.
SRK
  • 744
  • 3
  • 11
  • 23
17
votes
1 answer

XCode 6.3 MKPointAnnotation setCoordinate missing

I just updated XCode to 6.3 and now I am receiving the below error: MKPointAnnotation does not have a member named 'setCoordinate'. Not sure where it went, or if we are supposed to use some other MK method. Any help is appreciated. func…
Christopher Wade Cantley
  • 7,122
  • 5
  • 35
  • 48
13
votes
2 answers

Swift 3 Add custom annotation pin to MKMapSnapShotter snapshot

I'm learning Swift 3 on my own, and my current learning project involves allowing the user to snap a photo and get a map snapshot with the current location pinned. I've relied on this answer from Aug 2015 and this answer from Jun 2016 for guidance,…
niblettes
  • 165
  • 1
  • 8
12
votes
6 answers

Swift 3 - MKPointAnnotation custom Image

This is my code and i want to add a custom pin (.png file) instead of the red pin. I tried to use MKPinAnnotationView and MKAnnotationView but i couldn't add coordinates, subtitles and title. I'm new to iOS development. override func viewDidLoad()…
Alex Andreadis
  • 347
  • 1
  • 4
  • 17
12
votes
1 answer

how to set up array for multi annotations with swift

How should the array below be set. Im trying to add multiple annotations onto my map. I was able to find the code below on stackoverflow but they did not show how to set up the array. var objects = [ //how should the array be setup…
ThisISswift
  • 305
  • 2
  • 4
  • 14
9
votes
2 answers

MKPointAnnotations touch event in swift

I would like to know if anyone can tell me how I can touch a pin on the map in the form of MKPointAnnotations . I would like to click the pin on the map and go to another view by bringing back the variables of the pin that I have preset . Can anyone…
Mr. Developer
  • 3,295
  • 7
  • 43
  • 110
6
votes
2 answers

Add Annotations in MapKit - Programmatically

I am trying to add annotations to my map. I have an array of points with coordinates inside. I am trying to add annotations from those coordinates. I have this defined: var points: [CLLocationCoordinate2D] = [CLLocationCoordinate2D]() let…
H.N.
  • 1,207
  • 2
  • 12
  • 28
6
votes
3 answers

Identify MKPointAnnotation in mapView

I have at least 100 diferents Points ... how can associate each point with the position in my 'listOfPoints' assigning a tag in the position associated in viewForAnnotation . Here i add my Points, some events will have the same title. var…
Gilberto Ibarra
  • 2,849
  • 2
  • 27
  • 38
6
votes
1 answer

MKMapView MKPointAnnotation tap event not called

I am using a MKMapView (delegate is set correctly) with a MKPointAnnotation. The annotations are generated in this method called on a background thread. func updateMapAnnotations() { for var i = 0; i < DataManager.getStationList().count; i++ { …
Tim
  • 284
  • 2
  • 10
4
votes
1 answer

How to update information on MKPinAnnotationView?

I've had some past experience using MKMapView and MKPointAnnotation, which I used to put some pin on a map. This time I am trying to go one step further and use MKPinAnnotationView, to write a label along with some of the pins. Unfortunately, it…
Michel
  • 10,303
  • 17
  • 82
  • 179
4
votes
2 answers

MKPointAnnotation won't change colors

I need to change the color for an MKPointAnnotation object, but the method I wrote seems to only generate red pins. The method works fine, but when I call the function, passing the parameter of one of the given constant, all pins that appear on the…
Jake Byman
  • 540
  • 12
  • 29
3
votes
1 answer

Swift Mapview Custom Call Out View with default map view pins

I believe this is going to be a really easy answer but I've been trying to figure out how I add a custom callout view with map views default pins. With my current code it seems I can only add an image as the MKPointAnnotation instead of the default…
Lukas Bimba
  • 817
  • 14
  • 35
3
votes
0 answers

MKMapView hiding MKPointAnnotation when zoom

I need to show all MKPointAnnotations added to MKMapView all the time, but they keep hiding when zooming in and out the map, is there a property o delegate method to prevent this behavior ? Thank you!. Here is my code: var _mapviewMap:…
3
votes
1 answer

Swift MKPointAnnotation custom Image

I try to create a custom "badget" for my MKPointAnnotation in swift, but it fails as MKPointAnnotation does not have any property like image var information = MKPointAnnotation() information.coordinate = location information.title = "Test…
Fabian Boulegue
  • 6,476
  • 14
  • 47
  • 72
1
2 3 4 5 6 7