Questions tagged [mapkit]

MapKit is Apple's framework for presenting and annotating scrollable and zoom-enabled maps on iOS, IPadOS, tvOS, watchOS, and macOS.

MapKit is Apple's framework for presenting and annotating maps for iOS, IPadOS, tvOS, watchOS, and macOS. Maps are rendered via the MKMapView control, which offers scrolling, zooming, and optionally real-time highlighting of the user's current location on both traditional maps as well as satellite imagery.

Maps can be further customized by:

  • Adding annotations (information about a point on the map), which can then be represented on the MKMapView using annotation views, graphical representations (such as a drop pin or a custom image). Annotations also may have associated attributes (such as text that can appear in a callout box that appears when you tap on an annotation view), and these callout boxes can also have additional behaviors (e.g. left and right accessory controls that you can use to perform custom operations, etc);

  • Adding overlays, graphical representations between a collection of map points (e.g. a MKPolyline that represents one or more line segments, such as a path, along the map; a MKPolygon that represents a shaded portion of the map defined by the coordinates of a polygon, a MKCircle that represents a shaded circle around a particular map point, etc.). Overlays are represented by MKOverlayView objects which define the particulars of how the overlay is represented (line thickness, line color, shading, etc.).

  • The Map Kit framework also provides local search capabilities (as of iOS 6.1, OS X 10.9), via MKLocalSearch, which will asynchronously return establishments and points of interest based upon the search criteria.

The reverse geocoding, via MKReverseGeocoder, is deprecated as of iOS 5.0, superseded by the CLGeocoder class of the Core Location framework

MapKit is part of the following SDKs:

  • iOS 3.0 and later,
  • macOS 10.9 and later,
  • Mac Catalyst 13.0 and later,
  • tvOS 9.2 and later,
  • watchOS 2.0 and later.

###Related tags:

###References:

5877 questions
2
votes
2 answers

Swift 2 MapKit Annotations - How to group annotations?

I have close to 8.000 annotations in my map and I'd like to group them depending of the zoom that the user do in the app. All the latitudes and longitudes are already into the CoreData as Double. Case I have two different annotation images in the…
2
votes
3 answers

Can't get MapKit to work

Im following a tutorial on how to work with MapKit and I am having trouble getting past the first few steps of the tutorial. I have checked other tutorials and they all have the exact same initial steps. I place a Map Kit View onto my view…
Bingo
  • 375
  • 6
  • 17
2
votes
3 answers

Trying to select an annotation which has not been added

I am developing an app using swift and mapkit. The mapView has some annotations in addition to the mainUser annotation view. What I want is when the user selects a cell in a UITableViewCell from another ViewController, he should be brought to the…
Quentin Malgaud
  • 405
  • 6
  • 21
2
votes
3 answers

Opening MapKit pin in Maps

I can't seem to get the final part of Ray Wenderlich's mapkit tutorial to work. I get the pins to display correctly but when I click on the pin, it doesn't open in Maps as I would like it too. Here is the link to the full tutorial (Link) And here…
FredLoh
  • 1,804
  • 18
  • 27
2
votes
1 answer

Detect what route the user tap on map

I have a project where I show directions between current location and another location on a map (MapKit) All works well. And I can get alternative routes. request.requestsAlternateRoutes = YES; But when the user tap on a route I show an annotation…
Lars Ørjan Nese
  • 123
  • 2
  • 14
2
votes
1 answer

Combine latitude/longitude characteristics (Bluetooth LE) in Swift for Mapkit Annotations

I'm working on a tracker iOS app to track the (GPS) position of a device (the device is currently an Arduino Uno with Adafruit Bluefruit LE UART Friend for Bluetooth connection and a Ublox GPS module for GPS coordinates). I've set up the Arduino and…
fbossong
  • 21
  • 3
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
2 answers

MapKit: How can I pan and zoom to fit all my annotations?

So I've got a bunch of annotations spread out on my map... everything is just dandy. Now I need to be able to set the map's position and zoom so they all fit perfectly. How can I do this?
E-Madd
  • 4,414
  • 5
  • 45
  • 77
2
votes
0 answers

Why the MKScrollContainerView shows displaced in Xcode Debug View Hierarchy?

I have an iOS app using the MapKit framework. The app works fine except that when I go to debug the UI in Xcode using the Debug View Hierarchy I have an MKScrollContainerView entirely displaced (as shown in the attached screenshot). Any idea on how…
Daniele Orlando
  • 2,692
  • 3
  • 23
  • 26
2
votes
1 answer

Swift MapKit - add (extra)attribut to annotation?

I did this MapKit-Tutorial Everything works fine, but how can I add an extra attribut to my pin? This is my class Car: import Foundation import MapKit class Car: NSObject, MKAnnotation { let title: String let subtitle: String let thirdAttribut:…
kuzdu
  • 7,124
  • 1
  • 51
  • 69
2
votes
2 answers

initializing the mapkit with a particular latitude and longitude Iphone

Iam making an iphone app, which should take in latitude and longitudes from an array and should locate and display the map with a customized annotation/pins. I have used the mapkit here's how: //MapViewController.h #import #import…
binbash
  • 149
  • 3
  • 8
2
votes
2 answers

iOS 9 [locationManager.requestWhenInUseAuthorization()] alert view disappears quickly after appearing

I have a pretty basic app configured. It uses a navigation controller, along with a view controller that i have configured as my map view controller. When the app launches, it launches to the Root View Controller, and from there, i have a button…
Don Alejandro
  • 885
  • 1
  • 7
  • 16
2
votes
1 answer

mapkit: region that fits does not render correctly

I have a piece of code that determines both best region.span.latitudeDelta and region.span.longitudeDelta. It finds the top left and bottom right and takes the diff between lat-coordinates and long-coordinates. The problem I have is that rendering…
zevij
  • 2,416
  • 1
  • 23
  • 32
2
votes
0 answers

MapKit Overlays with kCGBlendModeMultiply

I have a very specific use case with MKMapView. I generate a big amount of MKPolygons (about 15000) and render them on an overlay. To increase the performance I do following steps: add one single overlay to the map view which is of size of the…
OlegLanger
  • 41
  • 4
2
votes
1 answer

How are you meant to redirect WatchKit app users to directions in the Maps app?

Reading the documentation, there are two ways I assumed I could do this. The first is with the Apple Maps URL scheme because the documentation claims "you can use map links to open that information in the Maps app in iOS, OS X, or watchOS 2 and…
Yanik Magnan
  • 597
  • 3
  • 8