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

How to call a function or tell if a MKPointAnnotation is clicked on a MKMapView SwiftUI

I've been trying to call a function when a pin on my map is clicked. I have about ten pins on my map, so how can I determine which pin is pressed and have all the data that the MKPointAnnotation contains? How each annotation is added to the map: …
Tucker
  • 57
  • 7
2
votes
0 answers

Add new button line to the bottom of MKPointAnnotation in swift

If it's a duplicate question then sorry for that. I researched several topics but could not find exact what i want. So I want to add several buttons as to MKPointAnnotation. I know how to add to left and right. But, I need as in following…
2
votes
1 answer

Longer subtitles in MapView annotations (swift)

I have a mapView with annotations displaying titles and subtitles. The subtitles are sometimes longer than the width of the annotation, so I am wondering if i can make them multiline? It's coded like this so far: func annotate(newCoordinate, title:…
Bullwinkle
  • 350
  • 4
  • 19
2
votes
1 answer

Saving map pins to array, Swift

I am creating a map type application, once the user presses a button a pin is dropped to the map at their current location. I am trying to save map pins to an array so that they remain once the app is closed. Here is my code so far: func…
Oscar
  • 511
  • 2
  • 10
  • 25
2
votes
3 answers

Annotation Pin for current location not appearing

I was trying to utilise map kit to show my current location using MKMapView and its delegate method, didUpdateUserLocation but when I zoom in and comes really close, I would see multiple pins. Then after some suggestions I realised, every time, the…
Natasha
  • 6,651
  • 3
  • 36
  • 58
2
votes
3 answers

How to make annotation point draggable in MapKit using swift 2 and xcode 7?

It is very frustrating to find the solution for this problem. I posted the whole code to understand the problem. Please help import UIKit import MapKit import CoreLocation class LocationViewController: UIViewController,MKMapViewDelegate,…
Sourabh Sharma
  • 8,222
  • 5
  • 68
  • 78
2
votes
1 answer

Swift error: fatal error: Cannot index empty buffer

I am new to Swift language. I've created a MapKit app that retrieves MKPointAnnotation data (lat, log and title) recursively from a Sqlite DB (latest FMDB stack). The purpose is to put a bunch of interest points on a MKMapViewDelegate. I've tried…
Max Uggeri
  • 21
  • 3
2
votes
1 answer

Change annotation pin color on MKMapView

I am trying to change colour of annotation pin on MKMapView by overriding this below: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id )annotation { // If it's the user location, just return nil. if ([annotation…
SanitLee
  • 1,253
  • 1
  • 12
  • 29
2
votes
0 answers

When setting new coordinates for MKPointAnnotation the pin disappears

When I try to move my MKPointAnnoatation like this: [UIView animateWithDuration:0.5 animations:^{ [user setCoordinate:coordinate]; The pin disappears on the map :( Is there a different solution to move a MKPointAnnotion? EDIT MORE…
jjuser19jj
  • 1,637
  • 3
  • 20
  • 38
2
votes
1 answer

Adding action to MKMapView annotation

I have a MKMapView with a bunch of annotations but I can't add an action to them. I was just creating an MKPointAnnotation, but I couldn't add an action to that. Whenever I click the annotation, nothing happens. Here is how I am setting the…
matthew
  • 467
  • 8
  • 23
2
votes
2 answers

pass a parameter from pin to other view

I have a problem with my MKPointAnnotation points dropped on a map. I'll explain. Scenario: Read JSON from server -> Drop pins on the map -> When a pin is clicked, then open a new view with a parameter passed to the view. The parameter must be…
Theodoros80
  • 796
  • 2
  • 15
  • 43
2
votes
1 answer

How to display multiple MKPointAnnotation's callout at once in MKMapView?

In iOS, only one MKPointAnnotation's callout can be displayed at a time. I would like to be able to show all of the pins' callouts on the screen at once. Any recommendations would be appreciated.
user1530580
  • 189
  • 3
  • 15
2
votes
1 answer

MKPointAnnotation add extra property

Is it possible to add an extra property to MKPointAnnotation? At the moment there is coordinate, title, and subtitle. Is it possible to add a url property which can be accessed within -(MKAnnotationView *)mapView:(MKMapView *)mapView…
Josh Boothe
  • 1,413
  • 4
  • 25
  • 40
1
vote
1 answer

MKPointAnnotation title not showing and annotation not draggable

I think those two are related and I'm probably doing something wrong here: First I'm overriding viewForAnnotation - in order to put my custom Image - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation { …
1
vote
0 answers

fetching locations points and title and showing on mapkit view

I add places using a longtapgesture recognizer and while it shows on my map, it dissapears when i leave the view and then comeback. so I'm adding the locations using firebase fetching the location and I want it to show on my mapview. I'm getting the…