mkmapview

MKMapView calling didSelectAnnotationView

强颜欢笑 提交于 2020-01-02 07:25:07
问题 I use MKMapView . On map I show clickable AnnotationViews . After click on AnnotationView , I push MyController to NavigationController . In MyController I click on the back button, after this my previous controller is show (do pop controller). When I click on AnnotationVIew in my previousController callback didSelectAnnotationView does not rased. Why it happened? 回答1: It because when I click on annotation it annotation selected and when I click on this annotation again it does not call

Render Title of MKPolygon

断了今生、忘了曾经 提交于 2020-01-02 07:10:19
问题 I'm trying to render MKPolygon using the following code: NSMutableArray *overlays = [NSMutableArray array]; for (NSDictionary *state in states) { NSArray *points = [state valueForKeyPath:@"point"]; NSInteger numberOfCoordinates = [points count]; CLLocationCoordinate2D *polygonPoints = malloc(numberOfCoordinates * sizeof(CLLocationCoordinate2D)); NSInteger index = 0; for (NSDictionary *pointDict in points) { polygonPoints[index] = CLLocationCoordinate2DMake([[pointDict valueForKeyPath:@

Detecting panning + decelerate of MKMapView

狂风中的少年 提交于 2020-01-02 06:16:13
问题 I'm trying to capture panning and the 'end of scrolling' on an MKMapView. Panning is easy to do with a gesture recognizer. However, MKMapView doesn't seem to implement a UIScrollViewDelegate in iOS 6. That makes the solution in Is there way to limit MKMapView maximum zoom level? not work. Thoughts? Ideally I would have just leveraged the UIScrollViewDelegate as such: -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { if ([super respondsToSelector:@selector

MKMapView release memory

帅比萌擦擦* 提交于 2020-01-02 04:47:07
问题 I have followed the advice available in several SO questions, like this one, in order to release MKMapView from memory - my code below - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; self.map.mapType = MKMapTypeHybrid; self.map.showsUserLocation = NO; self.map.delegate = nil; [self.map removeFromSuperview]; self.map = nil; self.locationManager.delegate = nil; } In part, it works, but not entirely. Let me provide some data. Below is the memory allocation recording

MKMapView Not Calling regionDidChangeAnimated on Pan

◇◆丶佛笑我妖孽 提交于 2020-01-02 03:33:07
问题 I have an app with a MKMapView and code that is called each time the map changes locations (in regionDidChangeAnimated). When the app initially loads, regionDidChangeAnimated is called on pans (swipes), pinches, taps and buttons that explicitly update the map coordinates. After loading other views and coming back to the map the regionDidChangeAnimated is only called for taps and the buttons that explicitly update the map. Panning the map and pinches no longer call regionDidChangeAnimated. I

How to add a transparent mask on map View [closed]

半腔热情 提交于 2020-01-01 19:47:05
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I want to add a color mask on my MapView screen (without coordinate, I want to display it on all my mapView) and keep the control on this mapView. I've heard about MKOverlay but I dont know how to use it for all

Custom map path line

偶尔善良 提交于 2020-01-01 15:35:03
问题 I'm having trouble with drawing a line on the map with a stroke. (inside color and outside color) I beleive i'm on the right path and have subclassed mkOverlayView to override the drawing (needs to fill with the road size) so inside drawMapRect... CGFloat lineWidth = MKRoadWidthAtZoomScale(zoomScale); MKMapRect clipRect = MKMapRectInset(mapRect, -lineWidth, -lineWidth); ... CGContextAddPath(context, path); CGContextSetStrokeColorWithColor(context, line.color.CGColor); CGContextSetLineJoin

MKCoordinateRegion distance between center and borders

北慕城南 提交于 2020-01-01 12:31:31
问题 (Revised Question based on comment:) OK I will try to ask in other way...How can I get border coordinates of this circle overlay: (Original Question:) I am having weird problem with my iPhone app. I have MKCoordinateRegion which has center coordinate latitude: 51.509980 and longitude: -0.133700. I have used method MKCoordinateRegionMakeWithDistance and set the distance to be 16,093.44 meters (10 miles). I want to get border point of this region therefore I have this code: MKCoordinateRegion

MKCoordinateRegion distance between center and borders

徘徊边缘 提交于 2020-01-01 12:31:22
问题 (Revised Question based on comment:) OK I will try to ask in other way...How can I get border coordinates of this circle overlay: (Original Question:) I am having weird problem with my iPhone app. I have MKCoordinateRegion which has center coordinate latitude: 51.509980 and longitude: -0.133700. I have used method MKCoordinateRegionMakeWithDistance and set the distance to be 16,093.44 meters (10 miles). I want to get border point of this region therefore I have this code: MKCoordinateRegion

MKAnnotationView setImage() on iOS 11 has an animation

蹲街弑〆低调 提交于 2020-01-01 10:09:10
问题 Since iOS 11, when I use setImage in my custom MKAnnotationView , the image is displayed with an animation. The problem is when I select and deselect the MKAnnotationView and the image has a different size. It results in a weird animation. No problem until iOS 11, can we stop this behaviour? 回答1: Seeing that this is the only mention of this issue (feature?) that I've found anywhere over the past year and a half, let me first thank you for being my only source of sanity. With that, I've