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

how to update custom MKAnnotationView after change to custom MKAnnotation data?

Is there a way to update custom MKAnnotationView after change to custom MKAnnotation data? Is this where observers come into play (haven't used these before). Currently for example I am doing the following manually: In my custom MKAnnotation after…
Greg
  • 34,042
  • 79
  • 253
  • 454
2
votes
1 answer

Default callout fill in the color of the left accessory view

Is there a way to get the left accessory view of the callout to just fill in the rest of the view with a background color? I am currently just doing it with this let leftView = UIImageView(image: UIImage(named: "leaf32")) leftView.backgroundColor =…
tnek316
  • 630
  • 1
  • 5
  • 16
2
votes
1 answer

Swift 2 - User's Current Location is inside MKPolygon

I am trying to check if the user's current location is inside the MKPolygon. I have created the following function but it returns false for all my test cases. Is there something I might be doing wrong? func isCorrectRegion(coordinates: Array,…
samk
  • 31
  • 4
2
votes
1 answer

MKMapCamera showing south

is there a way to load mapKit facing south instead of north in swift 2? I have tried MKMapCamera and looked at apple documentation but nothing I have read or tried is working. Thanks in advance.
Graeme K
  • 89
  • 8
2
votes
0 answers

IOS mapkit Direction for India

I know that there is no mapkit directions available for India ,Is there any way to get directions for india through IOS mapkit? Or any other suggestions?
jeremy gv
  • 77
  • 1
  • 10
2
votes
2 answers

Swift Xcode cant find MapKit as an outlet

after much researching i think i have found the problem of my coding. I am trying to setup a app where users can see their locations after where they are. I always get an error which says fatal error unexpectedly found nil while unwrapping an…
Tom James
  • 59
  • 10
2
votes
1 answer

SWIFT Thread 1: EXC Bad instruction XCODE IOS

I am very new to stackexchange so please let me know if i need to provide more information. I tried to install the Corelocation and Mapkit and use them togheter. Every since i followed Vea Software Tutorial i have recived the following error:…
Tom James
  • 59
  • 10
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
1 answer

iPhone - Image overlay MapKit framework?

I can see with iOS4 you can now tile an image on google maps (Been looking at the TileMap example from apple). This is great as this is what I want to do, but from what I can see I need to know the GEO reference of the image so I can raster the…
Peter
  • 749
  • 10
  • 27
2
votes
0 answers

How to let the user define a region?

I'd like to let the user define a region on a map. The region will be represented by a circle defined by a center and its radius. Here is a picture of the result I'd like to have : radius: I want the radius to be define with a small circle that…
bobby
  • 105
  • 1
  • 10
2
votes
1 answer

iPhone SDK - MapKit CoreLocation - Make street address from latitude and longitude

I have a problem in an app I am building. I can retrieve the users latitude and longitude, however I need to convert those values into an NSString street address. ie. "123 Park Street, Sydney". Any idea as to how I can create a street address from…
Joshua Russell
  • 670
  • 5
  • 13
2
votes
2 answers

How to Use MKMapViewDelegate Methods in MVVM Model

In my view controller, there is an outlet to a MKMapView and the view controller naturally conforms to MKMapViewDelegate to perform MapKit operations. I'm trying to migrate to the MVVM model before further progress in the project in order to keep it…
Can
  • 4,516
  • 6
  • 28
  • 50
2
votes
1 answer

While using MKMapview causing MBs of memory usage and using ARC it not releasing memory when View Disappears

using Xcode 6.0 and iOS 8.4 and what i have tried is: -(void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; mapView.mapType = MKMapTypeHybrid; mapView.mapType = MKMapTypeStandard; mapView.showsUserLocation =…
Ronak Chaniyara
  • 5,335
  • 3
  • 24
  • 51
2
votes
1 answer

How to use MKMapKit to generate polyline for Continental United States Boundary?

Note: If this question requires more information, please add a comment. Details: I would like to generate a boundary line around the continental United States on an MKMapView. The idea is to begin drawing overlays on the area outside of the country…
Tommie C.
  • 12,895
  • 5
  • 82
  • 100
2
votes
1 answer

Should I import a weak framework?

I have a framework that needs the Apple MapKit framework. I want to be sure that this framework is usable even on machine where MapKit is not available (aka AppleTV). Is it safe to use #import or should I use only reflection?
IgnazioC
  • 4,554
  • 4
  • 33
  • 46