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

Compass placing or position in a map view post iOS6

Does anyone know of a way to change the placing of the compass in MKMapview? I'm talking about the compass that shows up in the upper right corner of the map when it's rotated. I'm making it so you can see the map blurred underneath the navigation…
GetSwifty
  • 7,568
  • 1
  • 29
  • 46
23
votes
5 answers

Gradient Polyline with MapKit ios

I'm trying to trace a route on a MKMapView using overlays (MKOverlay). However, depending on the current speed, I want to do something like the Nike app with a gradient while tracing the route, if the color is changing (for example, from green to…
Dachmt
  • 2,079
  • 4
  • 29
  • 45
23
votes
6 answers

Swift - CLGeocoder reverseGeocodeLocation completionHandler closure

What I'm trying to do is pass a CLLocation to the function getPlacemarkFromLocation which then uses the passed CLLocation through reverseGeocodeLocation to set the CLPlacemark? that will be returned. I'm having issues creating the completionHandler…
AaronDancer
  • 649
  • 1
  • 7
  • 22
23
votes
4 answers

MapView in iOS6 won't show certain zoom levels at latitude > 75 north

This code sets a default zoom level centered around a specified location in viewDidLoad. The code works fine in previous versions of iOS: CLLocationDistance visibleDistance = 100000; // 100 kilometers MKCoordinateRegion region =…
Neur0mans3r
  • 231
  • 2
  • 3
22
votes
6 answers

iOS: Notification when MKMapView is loaded and annotations/overlays are added?

I am aware of the delegate methods used to let me know when the map has loaded and annotations and overlays have been added. (mapViewDidFinishLoadingMap: mapView:didAddAnnotationViews: mapView:didAddOverlayViews:) I am wanting to create a UIImage…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
22
votes
6 answers

Convert span value into meters on a mapview

Whenever the user zoom in or out the map i need to know how many meters are currently represented on the map (width or height). What i need is the inverse function of MKCoordinateRegionMakeWithDistance to calculate the distance represented by the…
vdaubry
  • 11,369
  • 7
  • 54
  • 76
22
votes
4 answers

iOS 10 heading arrow for MKUserLocation dot

The Maps app in iOS 10 now includes a heading direction arrow on top of the MKUserLocation MKAnnotationView. Is there some way I can add this to MKMapView in my own apps? Edit: I'd be happy to do this manually, but I'm not sure if it's possible?…
Ben Williams
  • 4,695
  • 9
  • 47
  • 72
22
votes
2 answers

how to highlight countries in ios maps

I am building an app in which I have to highlight some countries dynamically in the world map. In short I want to customize the whole view of ios maps as shown in the images. can this be done using MapKit or is there any other method. Thanks in…
Rajesh
  • 937
  • 1
  • 8
  • 14
22
votes
6 answers

Prevent scrolling in a MKMapView, also when zooming

The scrollEnabled seems to be breakable once the user starts pinching in a MKMapView. You still can't scroll with one finger, but if you scroll with two fingers while zooming in and out, you can move the map. I have tried : Subclassing the MKMapKit…
Nils Munch
  • 8,805
  • 11
  • 51
  • 103
21
votes
7 answers

MKMapView setRegion "snaps" to predefined zoom levels?

Can anyone confirm that setRegion "snaps" to predefined zoom levels and whether or not this behavior is as designed (although undocumented) or a known bug? Specifically, it appears that setRegion snaps to the same zoom levels that correspond to the…
charshep
  • 416
  • 4
  • 14
21
votes
6 answers

detect if a point is inside a MKPolygon overlay

I want to be able to tell if tap is within a MKPolygon. I have a MKPolygon: CLLocationCoordinate2D points[4]; points[0] = CLLocationCoordinate2DMake(41.000512, -109.050116); points[1] = CLLocationCoordinate2DMake(41.002371, -102.052066); points[2]…
Padin215
  • 7,444
  • 13
  • 65
  • 103
19
votes
4 answers

How to center my current location in MKMapView?

I am showing the current location in MKMapView by using showUserLocation enables. I also want to center the mapview to the user current location and also the zoomed map of location. Please help me regarding this as I don't get any help from other…
vipul
  • 426
  • 1
  • 5
  • 13
19
votes
3 answers

Custom pin image in annotationView in iOS

I'm trying to change from Swift 1.2 to Swift 2.0 and I'm at the end of the changes. Currently I'm making changes in the MapViewController, and there isn't any error or warning, but the custom image for my pin (annotationView) it's not assigned to…
Jordi Gámez
  • 3,400
  • 3
  • 22
  • 35
19
votes
1 answer

How to get center of an MKMapView map?

I have an MKMapView which allows the user to scroll the map around. Later, I want to get the latitude and longitude of the point at the center of the map, but can't find an easy way to do it. At the moment I'm trying something…
Haydn
  • 193
  • 1
  • 1
  • 5
19
votes
5 answers

Get the coordinates of a point from mkmapview on iphone

I'm trying to figure out how to put an annotation on a map based on where the user touches. I have tried sub-classing the MKMapView and looked for the touchesBegan to fire but as it turns out, MKMapView does not use the standard touches methods. I…
AtomRiot
  • 1,869
  • 3
  • 18
  • 24