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
28
votes
3 answers

How to draw a MKPolyline on a MapView?

I have an array of points to be drawn on a map, its already decoded: - (void) drawRoute:(NSArray *) path { NSInteger numberOfSteps = path.count; CLLocationCoordinate2D coordinates[numberOfSteps]; for (NSInteger index = 0; index <…
Fustigador
  • 6,339
  • 12
  • 59
  • 115
27
votes
7 answers

Check whether zoom level changed

I'm using MapKit on iPhone. How can I know when the user changes the zoom level (zoom in\out the map)? I've tried to use mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated; but that's called even when the map is only…
Rizon
  • 1,516
  • 4
  • 25
  • 45
27
votes
3 answers

Obtain user location from a MKMapView

Is it possible to use the MKMapView's own location manager to return the users current location to pass into a webservice? I have mapView.showsUserLocation=YES; and this does return a valid blue dot at my location, but in the simulator, its…
joec
  • 3,533
  • 10
  • 60
  • 89
27
votes
4 answers

is there a way to get directions in mkmapview using a built in apple API?

I know google maps are known to be the best maps out there, but i dont want to have to download a bunch of extra libraries and all that. I'd prefer to do something quick and simple to get a quick route from point A to B and be done with it. Is there…
Katushai
  • 1,510
  • 2
  • 14
  • 27
26
votes
3 answers

how to make mapview zoom to 5 mile radius of current location

I know its a very common issue but I am not getting the exact answer for this thing. How to make MKMapView defaults to a zoom of a 5 mile radius of current location. Thanks in advance.
Aisha
  • 1,559
  • 5
  • 20
  • 37
26
votes
7 answers

How to remove all annotations from MKMapView without removing the blue dot?

I would like to remove all annotations from my mapview without the blue dot of my position. When I call: [mapView removeAnnotations:mapView.annotations]; all annotations are removed. In which way can I check (like a for loop on all the…
Mat
  • 7,613
  • 4
  • 40
  • 56
26
votes
8 answers

Detecting touches on MKOverlay in iOS7 (MKOverlayRenderer)

I have an MKMapView with possibly hundreds of polygons drawn. Using MKPolygon and MKPolygonRenderer as one is suppose to on iOS7. What I need is a way of acting upon the user touching one of the polygons. They represent an area on the map with a…
manecosta
  • 8,682
  • 3
  • 26
  • 39
26
votes
10 answers

Zoom in a MKMapView programmatically

I'm using a MKMapView inside an iPhone app. When I click a button the zoom level must increase. This is my first approach: MKCoordinateRegion zoomIn = mapView.region; zoomIn.span.latitudeDelta *= 0.5; [mapView setRegion:zoomIn…
Hectoret
  • 3,553
  • 13
  • 49
  • 56
25
votes
2 answers

How can I know when MKMapview setRegion:animated: has finished?

I want to set a region on my MKMapView and then find the coordinates corresponding to the NE and SW corner of the map. This code works just fine to do that: //Recenter and zoom map in on search location MKCoordinateRegion region = {{0.0f, 0.0f},…
deadroxy
  • 1,699
  • 2
  • 17
  • 22
25
votes
3 answers

Car (Annotation) animation (like uber app) not working

I made one demo project (from Moving-MKAnnotationView demo on github) for moving car on map following is its link https://github.com/pratikbhiyani/Moving-MKAnnotationView I edit my code on the basis of given answer by vinaut but still problem is…
Pratik B
  • 1,599
  • 1
  • 15
  • 32
25
votes
2 answers

How to select a map pin programmatically

I am new to Maps Concept. Please find the attached image once. when i click the "pin" i am getting message says "Admire your smile" or any text..... Now i want like... when we select the table view, i need to raise that message for that pin(with…
Babul
  • 1,268
  • 2
  • 15
  • 42
25
votes
8 answers

iPhone: Detecting Tap in MKMapView

How do I detect a single tap on an instance of MKMapView? Do I have to subclass MKMapView and then override the touchesEnded method? Thanks, -Chris
ChrisJF
  • 6,822
  • 4
  • 36
  • 41
24
votes
5 answers

iOS MKMapView zoom to show all markers

I'm working with MKMapView and have plotted several points on the map. I have used the MKCoordinateRegion and MKCoordinateSpan to enable zooming etc around one of the points - but that's not what I want... I'm trying to use something similar to the…
Matt Facer
  • 3,103
  • 11
  • 49
  • 91
24
votes
3 answers

Swift - Add MKAnnotationView To MKMapView

I'm trying to add MKAnnotationView to MKMapView but I can't do it… Can anyone help me? Here is my code: override func viewDidLoad() { super.viewDidLoad() locationManager.desiredAccuracy = kCLLocationAccuracyBest …
Bogdan Bogdanov
  • 882
  • 11
  • 36
  • 79
24
votes
4 answers

Why am I crashing after MKMapView is freed if I'm no longer using it?

I have a MKMapView. Sometimes after my view controller is dismissed, I'll get a EXC_BAD_ACCESS. I turned on NSSZombies and it looks like the MKMapView's delegate — my view controller! — is being called, despite both the MKMapView and…
Steven Fisher
  • 44,462
  • 20
  • 138
  • 192