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
17
votes
9 answers

MKMapView show incorrectly saved region

I'm saving map region into user defaults when my iPhone app is closing like this: MKCoordinateRegion region = mapView.region; [[NSUserDefaults standardUserDefaults] setDouble:region.center.latitude…
17
votes
3 answers

New foursquare venue detail map

I really love the way foursquare designed venue detail view. Especially the map with venue location in the "header" of view ... How was it done? Details are obviously some uiscrollview (maybe uitableview?) and behind it (in the header) there is a…
animal_chin
  • 6,610
  • 9
  • 37
  • 41
16
votes
2 answers

Is the Current Location/Compass heading button available in the iOS sdk?

I am working on a sample map kit app for iOS. I have everything working and a toolbar button to toggle the MKUserTrackingMode. This may seem like a silly question but I have searched all the options in the IB and looked in the documentation, and I…
vichudson1
  • 881
  • 1
  • 10
  • 21
16
votes
4 answers

How to draw arc/curve line with MKOverlayView on MKMapView

Help needed now. I can draw lines with MKPolyline and MKPolylineView, but how to draw an arc or curve lines between two coordinates on the MKMapView? Great thanks.
Shiny
  • 583
  • 4
  • 16
16
votes
1 answer

Move the annotation on Map like Uber iOS application

I am working on a project where I need to create a similar iOS application to UBER and OLA where the car is moving based on the location. I'm looking for some kind of Library which can make Cars move and take turns smoothly just like OLA. For now, I…
16
votes
4 answers

MapView to show all annotations and zoom in as much as possible of the map

I basically have a map where I add two annotations and they are shown as expected. Then I´m using the following code: let annotations = [start, end] mapView?.showAnnotations(annotations, animated: false) And this zooms to show my map with the two…
J Doe
  • 161
  • 1
  • 1
  • 5
16
votes
7 answers

Reposition legal label ( MKAttributionLabel )

I'd want to move the Legal label to the right side. On iOS 6 and 7 the below solution was working fine, however on iOS 8.3 it seems to not work. I get the label, then with a timer (0.1 sec) in viewDidLayoutSubviews I call this method…
Templar
  • 1,694
  • 1
  • 14
  • 32
16
votes
3 answers

How can I plot addresses in Swift, converting address to longitude and latitude coordinates?

In Objective-C this code works fine to plot an address and it finds the longitude and latitude coordinates: NSString *address = @"1 Infinite Loop, CA, USA"; CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder…
agf119105
  • 1,770
  • 4
  • 15
  • 22
16
votes
3 answers

Trying to get the span size in meters for an iOS MKCoordinateSpan

When I need to make an MKCoordinateRegion, I do the following: var region = MKCoordinateRegion .FromDistance(coordinate, RegionSizeInMeters, RegionSizeInMeters); very simple - works perfectly. Now I wish to store the value of the…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
15
votes
7 answers

How to suppress the "Current Location" callout in map view

Tapping the pulsating blue circle representing the userLocation brings up a "Current Location" callout. Is there a way to suppress that?
charudatta
  • 409
  • 1
  • 7
  • 15
15
votes
2 answers

MKAnnotation not showing callout on MKMapView

I've got a MKMapView and I'm adding annotations like this: for (NSDictionary *tmp in response) { NSDictionary *places = [tmp objectForKey:@"place"]; NSDictionary *location = [places objectForKey:@"location"]; NSLog(@"long: %@…
Amit Shah
  • 4,176
  • 2
  • 22
  • 26
15
votes
3 answers

how to get the distance between two locations in miles in objective c?

how to calculate distance between two location in miles using distanceFromLocation method of mapkit framework. Thanks
Ayesha Fatima
  • 359
  • 2
  • 4
  • 16
15
votes
4 answers

Store data in MKAnnotation?

So I'm pretty new to Xcode and Objective-C. I have several ArtPiece objects with various attributes stored in an array. I then add them as MKAnnotations to the mapview. What I need to be able to do is send a reference to the array position they came…
Ryan
  • 570
  • 9
  • 25
15
votes
8 answers

How to display 2 lines of text for subtitle of MKAnnotation and change the image for the button on the right?

I am looking at Apple's MapCallouts example for map annotations and callouts (==bubbles that appear when you click on a pin). Every annotation there has coordinates, title and subtitle. I would like to display subtitle in 2 lines, i tried with: -…
DixieFlatline
  • 7,895
  • 24
  • 95
  • 147
15
votes
5 answers

How do you call a method on a UIView from outside the UIViewRepresentable in SwiftUI?

I want to be able to pass a reference to a method on the UIViewRespresentable (or perhaps it’s Coordinator) to a parent View. The only way I can think to do this is by creating a field on the parent View struct with a class that I then pass to the…
RichieAHB
  • 2,030
  • 2
  • 20
  • 33