Questions tagged [mkmapviewdelegate]

MKMapViewDelegate is a protocol that describes events originating from an MKMapView.

MKMapViewDelegate is a protocol that describes events originating from an MKMapView. Interested classes can get messages for changes to the map's annotations, overlays, visible region, and user location updates.

For more information, see the Apple Documentation for MKMapViewDelegate.

160 questions
0
votes
1 answer

DidSelectAnnotationView method is not getting called

I am implementing ordnance survey maps. I am able to display all annotations but didSelectAnnotationView method is not calling when tap on annotation. Here is the code, i have used below in viewForAnnotation method. OSAnnotationView *view =…
0
votes
1 answer

How can I center my mapview so that the selected pin is not in the middle of the map but in 1/3 of it?

I have coordinates of a single pin on my map. I try to center my map on that pin, but I don't want to keep the pin directly in the middle of the map, but in 1/3 of the screen. I tried to do it in the following workaround: let coordinateRegion =…
user3766930
  • 5,629
  • 10
  • 51
  • 104
0
votes
2 answers

how can I fetch the longitude and latitude from a specific point on my mapview in swift?

I have a MKMapView in my app and currently I'm fetching the center point of this map by using: longitude = mapView.centerCoordinate.longitude latitude = mapView.centerCoordinate.latitude but now instead of taking the center point of the map I want…
user3766930
  • 5,629
  • 10
  • 51
  • 104
0
votes
1 answer

How can I tell a subview to resize when its superview changes size?

I'm working on an iOS application that has a UIViewController whose view has a MapView as a subview. However, when I run the application and try to rotate the view in the simulator, it doesn't work as it should; it leaves a black box as shown: How…
Jake Sebright
  • 799
  • 8
  • 16
0
votes
1 answer

MKMapViewDelegate: substitute of listening to region change event

I have a map that helps a friends find each other. The number of friends are too high and scattered around the map. I want to only load the friends from my api that pertain to the current view the user sees. If the user swipes, different set of…
user1019042
  • 2,428
  • 9
  • 43
  • 85
0
votes
2 answers

Value of type 'MKDirectionsRequest' has no member 'setSource'

For the practice of MapKit in iOS using Swift 2.0 targeted version iOS 8.0 drawing path between two points I am getting errors in my code that you can see above. Here is my practice code: import UIKit import MapKit import CoreLocation class…
zeeshan nazakat
  • 151
  • 3
  • 18
0
votes
1 answer

How to know annotation index MKMapview ios

Hi i have 100 annotations in mapview ontap of one of its annotations i should get annotation index related to that. Does anyone have idea about getting tag number for that? Looking for any delegate method does.
Nagarjun
  • 6,557
  • 5
  • 33
  • 51
0
votes
1 answer

Loading new pins on MKMapView as user scrolls and zooms using AFNeworking

Initially I load 10 pins using AFNetworking and plot them on the map and set the map zoom level to fit these 10 pins, however in my database I have 1000 pins and I want to load them as the user scrolls or zooms, how would I go about doing this?
Sami
  • 1,374
  • 1
  • 16
  • 43
0
votes
1 answer

MKAnnotation always red post refresh

I have a MapViewController class and I set the mapView.delegate = self in viewDidLoad. When I first load the map, annotations are rendered correctly. However, after a refresh (e.g., after I hit a button in callout - say 'delete'), all the other…
zevij
  • 2,416
  • 1
  • 23
  • 32
0
votes
2 answers

Update location on map when I scroll map

I got .plist file from client which have addresses and their latitude and longitude. My requirement is, when I scroll mapview respective latitude and longitude would be updated and show proper location on map. e.g. Suppose I have current location on…
iPhone
  • 4,092
  • 3
  • 34
  • 58
0
votes
0 answers

Swift Map Variable Disappears

I am trying to set up a map that zooms in on a location. Everything should be fine, but the map becomes unexpectedly nil and I can't figure out why. @IBOutlet weak var map: MKMapView! var numberOfAnnotations = 0 override func viewDidLoad() { …
IFM
  • 1
  • 1
0
votes
3 answers

In iOS 7+ MKMapView calls mapView:didUpdateUserLocation: forever

In my MapView in a button tap I run the following action: - (IBAction)locate:(id)sender event:(UIEvent*)event { DLog(@""); if ([self.mapView respondsToSelector:@selector(userTrackingMode)]) { [self.mapView…
0
votes
0 answers

mapView didUpdateUserLocation doesn't refresh

When applications state changed to "applicationEnterBackground", -mapView didUpdateUserLocation method doesn't refresh so receiving device's location is being impossible. So I can't draw user's traveled roads to the map. It only draws just one line…
0
votes
0 answers

MKMapView's delegate is not called

I have an UIViewController class to manage an MKMapView defined like this: @interface MapViewController : UIViewController Within the implementation of this view controller, I have: - (void)loadView { MKMapView *mapView =…
AppsDev
  • 12,319
  • 23
  • 93
  • 186
0
votes
2 answers

MKMapView viewForAnnotation not call in iOS 8

MKMapView delegate methods not called in iOS 8. In viewDidLoad: CGRect mapViewFrame = CGRectMake(0.0, 129.0, 320.0, 419.0); _mapView = [[MKMapView alloc] initWithFrame:mapViewFrame]; [_mapView setMapType:MKMapTypeStandard]; [_mapView…
Joker
  • 167
  • 1
  • 3
  • 12