mkmapview

rotating MKMapView

久未见 提交于 2019-12-10 11:28:56
问题 I have a working app with an MKMapView showing user location. So far, so good: - (void)viewDidLoad { ... [myMapView setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; [myMapView setUserTrackingMode:MKUserTrackingModeFollow animated:YES]; } Now, I allow interface rotations: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations. return YES; } If I now turn the device and center to the user location [myMapView

MKMapView crash

淺唱寂寞╮ 提交于 2019-12-10 11:20:01
问题 I could not figure out when exactly crash, because sometimes it happens and most time not. It crash when added new annotation and the pin has dropped down, or when the pin location has changed(drag). My ios version is 4.3.1 Crash: Thread 0 Crashed: 0 libobjc.A.dylib 0x3489dc98 objc_msgSend + 16 1 MapKit 0x336699a4 -[MKMapView mapTileViewDidStartLoading:] + 40 2 CoreFoundation 0x33589efc -[NSObject(NSObject) performSelector:withObject:] + 16 3 Foundation 0x327657a2 __NSThreadPerformPerform +

How can hide legal link of the mkmapview monotouch iPhone

梦想与她 提交于 2019-12-10 10:54:06
问题 MKMapview have legal link on its bottomright point. I want to add a button on this place. the button have some kind of transparency. can I hide the legal link? Or if i set my buttons in a way that hide this link may apple reject my app? I also have some kinds of subviews in my map view. 回答1: You SHOULD NOT hide this legal link or your app will be rejected by Apple. EDIT : I've found a category wich allows you to move this link, I'm not the author : https://github.com/bartvandendriessche

Map Annotations Search

♀尐吖头ヾ 提交于 2019-12-10 10:47:07
问题 I followed a how-to-search-for-location-using-apples-mapkit about searching annotations in mapView and its searching around the world with MKLocalSearch . However, I don't want to to search with MKLocalSearch but search my own annotations i added myself like these for example: let LitzmanLocation = CLLocationCoordinate2DMake(32.100668,34.775192) // Drop a pin let Litzman = MKPointAnnotation() Litzman.coordinate = LitzmanLocation Litzman.title = "Litzman Bar" Litzman.subtitle = "נמל תל אביב 18

How to draw routes that aren't on roads, MKMapView

ε祈祈猫儿з 提交于 2019-12-10 10:35:33
问题 So i've been experimenting with the MKMapView and overlay to create "roads that aren't on roads". That may sound weird but what I was trying to do is that in my app for iOS i want to draw the excursion routes that a specific hotel offers, however all the posts i found so far were focusing on existing roads, since the excursions go through forests, over rivers etc. there are no roads to help me. Since there were no roads i had to improvise so I decided to make a plist(I probably could have

Adding an UIView over a MKMapView

会有一股神秘感。 提交于 2019-12-10 10:30:41
问题 I am trying to put a button in the corner of my MKMapView to control whether the map stays locked on to the user's location. What I have in mind is to create a UIView with a button on and add it over my MKMapView (not as an annotation or something) I can't figure this out with Interface Builder. How can I add this button programmatically? Controlling whether it actually follows the user etc. is already sorted - just need the button for it. 回答1: It looks like you are directly setting the

How to adjust region to fit custom annotation callout that have just appeared?

混江龙づ霸主 提交于 2019-12-10 09:45:26
问题 I use my custom subclass of MKAnnotationView. In mapView:didSelectAnnotationView: method of my Map's delegate I call the method of this class, which adds UIImageView with an image as a subview - it serves as my custom annotation callout. When using default MKPinAnnotationView map does automatically adjust map region to display the annotation callout that have just appeared. How can I implement this behavior using custom MKAnnotationView subclass? 回答1: Current solution I've crafted demo

MKRoute update MKPolyline Overlay when current Location changes

烈酒焚心 提交于 2019-12-10 08:59:13
问题 I did google a lot but couldn t get this to work. In my MKMapView I have a custom MKAnnotationView that I can place anywhere and also that dot that is representing my current location. I can do "show directions" calculate MKDirections between my custom annotation and my current position and draw a MKPolyline overlay to show the MKRoute. So far so good. If I am moving now towards my custom annotation, the Polyline Overlay does not update, does not substract the distance I already traveled. I

Strange error: Can't render polygon

天涯浪子 提交于 2019-12-10 02:23:38
问题 I use a MKMapView to display about 700 annotations in total. My issue is that sometimes I get a huge log like this: 2013-06-05 17:32:12.395 tiet[1493:1c52b] Can't render polygon (can't reserve indicies: 324): featureID: 1547811419 key: 73.35.7 (512) 2013-06-05 17:32:12.396 tiet[1493:1c52b] Can't render polygon (can't reserve indicies: 480): featureID: 1547811419 key: 73.35.7 (512) 2013-06-05 17:32:12.396 tiet[1493:1c52b] Can't render polygon (can't reserve indicies: 30): featureID: 1547811419

Open Map Annotation from Selected Row in Table View

半世苍凉 提交于 2019-12-10 01:00:35
问题 I have a map view in one class with all of my annotations with titles and subtitles. There is a nav bar button that shows a list of all of those titles and subtitles. I'm wanting to be able to select a row in the table view and have it open the annotation with the same title in the map view. Any help? The only problem I have now is getting the annotation to show when the map view opens. I know I need to use selectAnnotation: animated: but I'm having trouble figuring out how to tell it to open