mkmapview

iOS 6 Map doesn't zoom with MKUserTrackingModeFollow

一曲冷凌霜 提交于 2019-12-07 11:13:38
问题 While my iOS6 MKMapView is in MKUserTrackingModeFollowWithHeading or MKUserTrackingModeFollow , zoom gestures (pinch, double-tap, two-finger tap) work sometimes, but not always. The issue seems to occur when didUpdateUserLocation: is called after regionWillChangeAnimated and before regionDidChangeAnimated . Any ideas on how to fix this? To isolate the problems, I've created a Single View Application with an MKMapView and a UIToolbar (set up in a .xib), to which I'm adding a

showsUserLocation returns pin instead of blue dot in iPhone simulator

喜你入骨 提交于 2019-12-07 09:56:53
问题 This is my -mapView:viewForAnnotation method which drops pins when i create annotation views. But when i set mapView.showsUserLocation = YES; in -viewDidLoad , i get a pin dropped on Infinite Loop (expected - in simulator) and not the normal blue dot. - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{ MKAnnotationView *anno = nil; //create a pin annotation view MKPinAnnotationView *pin=[[[MKPinAnnotationView alloc] initWithAnnotation

Adding MKOverlayPathRenderer as overlay to MKMapView gets exception

吃可爱长大的小学妹 提交于 2019-12-07 08:35:27
Everything said in topic, so here is the code - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. _pathRenderer = [[MKOverlayPathRenderer alloc] init]; _pathRenderer.lineWidth = 8.0f; _pathRenderer.strokeColor = [UIColor redColor]; _pathRenderer.path = CGPathCreateMutable(); [_mapView addOverlay:_pathRenderer]; } At the last line it drops with exception: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MKOverlayPathRenderer boundingMapRect]: unrecognized selector It means that i'm using wrong

How to make custom MKAnnotation draggable

狂风中的少年 提交于 2019-12-07 07:14:49
问题 I need MKAnnotation with different pin image. So I created following: @interface NavigationAnnotation : NSObject <MKAnnotation> - (id)initWithName:(NSString*)name address:(NSString*)address coordinate:(CLLocationCoordinate2D)coordinate; ... @interface NavigationAnnotation () @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *address; @property (nonatomic, assign) CLLocationCoordinate2D theCoordinate; @end @implementation NavigationAnnotation - (id)initWithName:

MKMapView inside a UITableViewCell

。_饼干妹妹 提交于 2019-12-07 05:28:26
问题 I have a UITableView with UITableViewCells that contains a MKMapView. The Problem: if the table cell ever gets selected, then move the map, you see the mapview is all white and you only see the "Legal" label. Has anyone experienced this before? Here is the entire code: @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.table.backgroundColor = [UIColor clearColor]; } - (void

iphone app: Questions on interaction between CLLocationmanager and MKMapView (showing current user location)

浪尽此生 提交于 2019-12-07 05:25:19
问题 In my iPhone app, I have the following logic: Start CLLocationManger (the user can supply accuracy and distance filters parameters to locationmanager, since best accuracy is not required in my case, 100-300 meters will do fine, and I'd like to save battery on this). After GPS fix is obtained by LocationManager (and only if this fix is obtained), I create and display the map. Both CLLocationManager and MKmapView are part of the same ViewController. To show the current location, I set mapView

App crashing when I add overlay to mkmapview

孤街浪徒 提交于 2019-12-07 04:34:57
问题 I am trying to add annotations and overlays to a mapview but it crashes randomly. It is an EXC_BAD_ACCESS error, but zombies doesn't tell me anything. It says it is crashing on CG::Path::apply_transform(CGAffineTransform const&). I have looked everywhere for why this is happening but can't pinpoint it. I am creating the mapview in ib and have the delegates and everything set up right. It will work sometimes and then crash randomly. I am using a gesture recognizer to add the annotations and

MKMapView tiles not loaded with zoom

两盒软妹~` 提交于 2019-12-07 03:28:57
问题 I've got an issue. I'm using a MKMapView for displaying some annotations. I initialize a map view with default zoom. And it displays some map. but when i try zooming, tiles not loaded, and map becomes empty. Like this. I create my Map View via interface builder. @property (nonatomic, weak) IBOutlet MKMapView* mapView; What am I doing wrong? Is there any mandatory methods for implementation, that affect on this functional? And yes, there is an internet connection on my device. 回答1: Generally

MKMapView crashes app when view controller popped

混江龙づ霸主 提交于 2019-12-07 03:05:51
问题 I have a view controller with an MKMapView that calls [self.mapView setRegion:region animated:YES]; which repositions the map from A to B. The view controller which holds the MKMapView is set as the delegate and in - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated I have some code that will trigger another setRegion:animated: to the MKMapView so that the map will zoom in on the new position automatically. Everything works fine if I popViewControllerAnimated: the view

Google Maps event that is called when all visible map tiles are loaded

无人久伴 提交于 2019-12-07 02:58:09
问题 Is there a way to programmatically determine when Google Maps is done loading visible image tiles in an MKMapView? I would like to take a screenshot of a view in an iPad app that has a Google Map in it, but I don't know how long to wait before taking the screenshot. I can't seem to find an event that triggers when tiles are done loading so the screenshot will actually have images in it, instead of a blank gray background. 回答1: This method: - (void)mapViewDidFinishLoadingMap:(MKMapView *