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
5 answers

MKPolygon - How to determine if a CLLocationCoordinate2D is in a CLLocationCoordinate2D polygon?

I have the swift code below that draws a polygon and drops an annotation on MKMapView. I am trying to figure out how i could identify if the annotation's coordinate is within the polygon? import UIKit import MapKit class ViewController:…
Sicong Liu
  • 113
  • 1
  • 2
  • 7
2
votes
3 answers

iPad Mapkit and Conical Projections

I read in the iPad mapkit is designed to use Mercator projection maps. It is possible to use this interface with Lambert Conical Projection maps?
2
votes
3 answers

Is there a way to get directions(just routes) using google for mkmapview?

I'm using swift on iOS and using MKMapView. I've been working on giving a user a from - to textfield and letting the user have a form of route between the from and to locations. I've got that working on mkmapview using the built in directions and…
DatForis
  • 1,331
  • 12
  • 19
2
votes
2 answers

Swift : Trying to start MapKit location updates without prompting for location authorization

I'm using XCode 7.0 Beta and Swift. I'm using MKMapView to display some places on a Map. Everything is ok : I see the Map and the place on the Map but I've the following error message : Trying to start MapKit location updates without prompting for…
Ghislain Bruyere
  • 373
  • 1
  • 2
  • 10
2
votes
1 answer

Maps using mapKit displays the opposite directions (iOS Swift)

I'm trying to display instructions using Apple maps from a user's current location to a location that was previously pinned. Here is my code... Here I store a global variable called carInitalLocation and carInitialCoordinate as the initial…
kebabTiger
  • 642
  • 7
  • 15
2
votes
2 answers

Swift/iOS MapKit function on MKAnnotation tap

I have a map and I have added 12 Annotations to it perfectly, what I would like is so that when someone taps on these Annotations it would have an info button to the right of the annotation which when tapped would show directions to the annotation…
user4011770
  • 29
  • 1
  • 4
2
votes
2 answers

"Cannot find an initializer for type 'MKPlaceMark' that accepts an argument list of type

I am getting two errors with this code: "Cannot find an initializer for type 'MKPlacemark' that accepts an argument list of type '(coordinate: CLLocationCoordinate2D, addressDictionary: [NSString : String])' and "Cannot invoke…
Jack Berstrem
  • 535
  • 1
  • 5
  • 22
2
votes
0 answers

iOS mapview and loading pin data from a web service. When to load new data

I'm currently loading data into a mapview from a web service, where there are more rows then I can return in one query. As such I'm trying to work out the best way to display these to the user. My intitial thought is to load 100 pins when the…
TommyBs
  • 9,354
  • 4
  • 34
  • 65
2
votes
0 answers

Connection was interrupted to zoom UI server in Xcode running on Device

I have absolutely NO CLUE, what this error means: |error| Connection was interrupted to zoom UI server. I'm getting this error when I try to insert data in Sqlite. Any ideas?
Faridullah
  • 41
  • 5
2
votes
2 answers

When I zoom my mapView to show my annotations, the selected annotations are partially off screen

When I execute the following code snippet, the map zooms correctly to encompass all annotations, however the callouts are partially offscreen. What is the most elegant way of fixing that? func mapView(mapView: MKMapView!, didAddAnnotationViews…
Zoef
  • 228
  • 2
  • 13
2
votes
0 answers

Limit the MapView to a certain area but still able to zoom in and out

Is it possible that I limit MKMapView to a certain area but I can still zoom in and out on that area? func mapView(mapView: MKMapView, regionDidChangeAnimated animated: Bool) { var span = MKCoordinateSpanMake(0.055, 0.055) var…
Mark Maraya
  • 225
  • 2
  • 9
2
votes
1 answer

How can I calculate the radius of the region visible in a MKMapView?

I'm using QuickBlox and I have a map that updates with users' locations. I'm getting the users' locations and placing them on the map using the "QBRequest.geoDataWithFilter" function. I'm creating a filter that has a radius value. I'm also using…
DatForis
  • 1,331
  • 12
  • 19
2
votes
0 answers

Swift Ios 8 MKPolylineRenderer to trace location

Hi so i am having trouble with trying to create this MKPolyline for my ios 8 app. This is suppose to trace the users's location and draw a line where ever it goes. I have been looking at tutorials online and they are using ios 7 or 6. Any help would…
Brian Chiem
  • 71
  • 1
  • 7
2
votes
0 answers

Draw path on MKMapView/Google map for building or parking place

Currently i am working on iOS project in which i have to draw path for building or parking place annotation, may be multi-level parking or basement parking. Enable to find solution in google map or MKMapView. Can anybody who are familiar with such…
2
votes
1 answer

Find addresses from array and send it other view

I'm trying to do simple thing. I want to find an array of addresses and show it on map. But then I need to pass data to another view. The problem is: I need to pass data from dictionary which contains address, so, I need to know which exactly…
Lippy Flo
  • 31
  • 3
1 2 3
99
100