Questions tagged [mkmapview]

MKMapView is part of Apple's MapKit framework for developing location-aware iOS applications, and provides an embeddable map interface. Effective iOS 6, the MapKit framework uses Apple's own map service. In iOS 5.1 and earlier, the framework uses the Google Mobile Maps service.

MKMapView is part of Apple's MapKit framework for developing iOS applications, and provides an embeddable map interface. Effective iOS 6, the MapKit framework uses Apple's own maps service. In iOS 5.1 and earlier, the MapKit framework used the Google Mobile Maps service, as described in the MKMapView Class Reference:

Important: In iOS 5.1 and earlier, the MapKit framework uses the Google Mobile Maps (GMM) service to provide map data. Use of specific classes of this framework (and their associated interfaces) is subject to the Google Mobile Maps terms of service. You can find these terms of service at https://web.archive.org/web/20120225140619/http://code.google.com/apis/maps/iphone/terms.html.

References:

4988 questions
51
votes
11 answers

Show Current Location and Update Location in MKMapView in Swift

I am learning how to use the new Swift language (only Swift, no Objective-C). To do it, I want to do a simple view with a map (MKMapView). I want to find and update the location of the user (like in the Apple Map app). I tried this, but nothing…
PMIW
  • 757
  • 2
  • 7
  • 15
50
votes
6 answers

NSSet to NSArray casting calling objectAtIndex?

I'm trying to update an MKMapView by removing all annotations outside the visible area, and adding and removing some annotations inside the visible area. This is my code: NSSet *visibleAnnotations = [mapView annotationsInMapRect:[mapView…
benwad
  • 6,414
  • 10
  • 59
  • 93
47
votes
3 answers

MKMapView MKPointAnnotation tap event

I have a list of annotations (MKPointAnnotation). I have a UIViewController which is for the whole view, MKMapView implementing Controller, which I thought is useful for detecting the users interaction with the map, my own MKPointAnnotation…
Ravi Vooda
  • 5,216
  • 5
  • 19
  • 25
46
votes
11 answers

Convert MKCoordinateRegion to MKMapRect

I have a square MKMapView in my app, and I wish to set a center point and the exact height/width of the view in meters. Creating an MKCoordinateRegion and setting the map to it (as in this code... MKCoordinateRegion region =…
Jon Cox
  • 10,622
  • 22
  • 78
  • 123
43
votes
3 answers

Customize the MKAnnotationView callout

I want to create a custom MKAnnotationView callout as shown in this image. I have tested several solutions but they only allow customization of the left/right images and title/subtitle. Can anybody please give me some source code or tutorial link…
Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
43
votes
3 answers

Snapshot of MKMapView in iOS7

I am trying to create a snapshot of a MKMapView in iOS7 application the same way it's recommended everywhere for previous iOS versions: - (UIImage*) renderMapViewToImage { UIGraphicsBeginImageContextWithOptions(mapView.frame.size, NO, 0.0); …
Michael
  • 603
  • 2
  • 7
  • 8
42
votes
5 answers

How to search MKMapView with UISearchBar?

I have an application that needs to have a similar search feature like the Apple "Maps" application (included with iPhone, iPod Touch and iPad). The feature in question should not be a hard thing to do, but I'm really clueless about how to input a…
Goles
  • 11,599
  • 22
  • 79
  • 140
40
votes
7 answers

iOS - MKMapView place annotation by using address instead of lat / long

I am able to place annotations on my MKMapView by using latitude and longitude, however, my feed coming in that I need to use location for is using street addresses instead of Lat and Long. e.g 1234 west 1234 east, San Francisco, CA ... Would this…
Romes
  • 3,088
  • 5
  • 37
  • 52
40
votes
8 answers

How do I remove all annotations from MKMapView except the user location annotation?

I use removeAnnotations to remove my annotations from mapView but same it remove user location ann. How can I prevent this, or how to get user ann back to view? NSArray *annotationsOnMap = mapView.annotations; [mapView…
Pavel Kaljunen
  • 1,291
  • 2
  • 26
  • 53
39
votes
2 answers

UIPanGestureRecognizer on MKMapView?

I would like to add some logic when user moves with map view i. e. he does a pan touch. But when I add the gesture recognizer and I want to log the touch, nothing happens. When I try it in another view controller and add the recognizer to…
JakubM
  • 2,685
  • 2
  • 23
  • 33
39
votes
11 answers

How to move a MKAnnotation without adding/removing it from the map?

Is it possible to move the coordinate of a MKAnnotation without adding and removing the annotation from the map?
DevDevDev
  • 5,107
  • 7
  • 55
  • 87
39
votes
10 answers

Getting the bounds of an MKMapView

In order to setup a query to an external server I want to get the bounds of the current Map View in an iPhone app I'm building. UIView should respond to bounds but it seems MKMapView doesn't. After setting a region and zooming in the map I try to…
deadroxy
  • 1,699
  • 2
  • 17
  • 22
38
votes
4 answers

How to disable user interaction on MKMapView?

How do you disable user interaction to an entire Map (MKMapView) in iOS? I just want to disable zooming, tapping, etc and show a static map. [self.mapView setUserInteractionEnabled:NO] didn't work. Found no working solutions via Google or other…
eric
  • 4,863
  • 11
  • 41
  • 55
35
votes
3 answers

MapKit not showing custom Annotation pin image on iOS9

My code worked fine from iOS 7 to 8. With the update yesterday the custom images on my pins were replaced by the standard pin image. Any suggestions? My code: extension ViewController: MKMapViewDelegate { func mapView(mapView: MKMapView,…
Felix Weber
  • 518
  • 1
  • 4
  • 8
35
votes
3 answers

Stop iOS 7 MKMapView from leaking memory

I've noticed that my app leaks memory, but if I take the MKMapView out the memory problem goes away. To test the theory, I made a dead simple project that has a view that pushes a view with a MKMapView in it and pops and pushes. Nothing more. No…
codercat
  • 22,873
  • 9
  • 61
  • 85