Questions tagged [mkmapitem]

MKMapItem is used to represent the data about a specific point on a map.

MKMapItem is used to represent the data about a specific point on a map. It is most commonly used to represent the results of a map-related search (e.g., fetching directions or nearby points of interest) or to pass known data to the Apple Maps application for plotting and display.

For more information, please see the Apple Documentation for MKMapItem.

62 questions
2
votes
1 answer

MKMapItem not showing correct info on MKPlacemark

I get the results of a MKLocalSearch and it includes something like... { address = { formattedAddressLine = ( "Marton Road", Middlesbrough, TS1, England ); …
Fogmeister
  • 76,236
  • 42
  • 207
  • 306
2
votes
1 answer

'MKMapItem' is not convertible to 'CLPlacemark'

How can I convert MKMapItem to CLPlacemark in Swift? My code gives me a compiler error 'MKMapItem' is not convertible to 'CLPlacemark': var mapItems:[MKMapItem] = [] let mi = self.mapItems[indexPath.row]; ann.placemark = mi as CLPlacemark In ObjC I…
Shmidt
  • 16,436
  • 18
  • 88
  • 136
2
votes
1 answer

Adding custom objects to a Parse backend iOS

I am building an application that stores locations in a list and later maps them. The problem I'm running into is an inability to save MKMapItems to a Parse database. I need to save these MKMapItems because they are the only unique identifiers for…
Ankush Agrawal
  • 395
  • 2
  • 14
2
votes
2 answers

MKAnnotation or MKMapItem

What's the difference between MKAnnotation and MKMapItem? Which one to use when I want to display some interesting places on my map? I have a list of objects that have latitude, longitude, title, description and photo so far and I'd like to have…
Kamil Lelonek
  • 14,592
  • 14
  • 66
  • 90
2
votes
1 answer

MKMapItem recognized in iOS 5?

So I'm using NSClassFromString to check if the user has iOS 5 or iOS 6 installed to use Apple's new iOS 6 MKMapItem. This is the code: - (void)openDirections:(id)sender { Class mapClass = NSClassFromString(@"MKMapItem"); if (mapClass ==…
Crystal
  • 28,460
  • 62
  • 219
  • 393
1
vote
1 answer

MKPointAnnotation to MKMapItem

I'm getting an error "Could not cast value of type 'NSKVONotifying_MKPointAnnotation' to 'MKMapItem'" when trying to open Apple Maps for directions. I'm new at this and I've been piecing together code to try to make it work. struct Location { …
jvan
  • 173
  • 1
  • 9
1
vote
0 answers

NSInvalidArgumentException: -[MKMapItem encodeWithCoder:]: unrecognized selector sent to instance 0x17034bfd0

I got a crash report, which is about unrecognized selector sent to instance when saving MKMapItem into Data Store. According to MKMapItem documents(MKMapItem Document), it conforms to NSSecureCoding, which means that it should have no problem to…
soloSwift
  • 13
  • 6
1
vote
0 answers

MKMapItem not updating name value

I'm launching the iOS maps from my app but is showing "Unknown Locations". Here is how adding the title to the location: @IBAction func directionsToLocation(_ sender: Any) { let destionationMapItem = MKMapItem(placemark:…
user2924482
  • 8,380
  • 23
  • 89
  • 173
1
vote
0 answers

Map Directions From Pins

Im creating a tagging app where users can tag Street Art to a map. I want users to be able to click on the pins (i) callout button and be taken to Apple Maps. This function should allow that to happen however I get an error "instance member…
1
vote
1 answer

iOS MKMapItem's openInMaps(launchOptions:) does not trigger viewWillDisappear

I am opening from my ViewController the Maps.app via openInMaps(launchOptions:) and it does not trigger any lifecycle method when leaving or going back to the app. Example Project: https://github.com/raphaelseher/OpenInMaps Example Code: let…
Rags93
  • 1,424
  • 1
  • 14
  • 14
1
vote
1 answer

MKPolyline Intersecting coordinates ios

Please check this image first I have an array of lat long coordinates through which I created a MKPolyline now I want to find the intersecting point coordinates lat long of two MKPolyline. For this I have tried MKPolyLine Intersects or not method…
1
vote
2 answers

MKMapAnnotaion view callout contains tableview and uitableviewcells are not accessible

I want to set Accessibility label for uitableviewcell. When i add tableview as MKMapViewAnnotation content I am not able to select tableviewcell through accessibility. When I debug tableview inside MKMapAnnotation isAccessible is always NO and…
1
vote
0 answers

Opening maps from iOS today extension while screen is locked

I have a today extension that opens a map via a call of MKMapItem.openMapsWithItems. It works fine if the phone is not locked, but if the today extension is opened from the lock screen, the call doesn't do anything. I would expect the same to happen…
Markus
  • 436
  • 3
  • 13
1
vote
1 answer

MKMapItem error in swift 2.0

When I run the following code, I get the error "Cannot call value of non function type 'MKMapItem?' request.source(MKMapItem.mapItemForCurrentLocation()) It worked fine in swift 1.2 what has changed ?
sumesh
  • 2,179
  • 2
  • 21
  • 37
1
vote
1 answer

IOS/MapKit: Launch Native Map App by Clicking on MKPlacemark

IOS newb just learning Mapkit. I load a map in my app using MKPlacemark. However some users may want to use more advanced features such as driving directions and for this, I think, they would be better off launching the native app on top of mine…
user1904273
  • 4,562
  • 11
  • 45
  • 96