mkannotationview

Draw a circle of 1000m radius around users location in MKMapView

谁说胖子不能爱 提交于 2019-12-28 01:43:46
问题 (Using iOS 5 and Xcode 4.2) I have an MKMapView and want to draw a circle of 1000m radius around the user location. On the surface it would seem that implementing the mapView:viewForAnnotation: map view delegate method, and adding a custom MKAnnotationView for the users location, would be a perfect solution. It would look something like this: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { // If it's the user location, return my custom

Binary operator '==' cannot be applied to operands of type '[MKAnnotation]' and 'MKAnnotation'

别说谁变了你拦得住时间么 提交于 2019-12-25 15:53:45
问题 I'm working on a tvOS app, where I want to be able to swipe between annotations. I store my annotations in a Dictionary, and store the Dictionary in an Array for future use. I am simply plotting three annotations for Canada, USA, and Mexico. I want to be able to swipe on the remote between these annotations. When an annotation is clicked, it will take you to information about that country. let countriesArray = ["Canada", "Mexico", "United States of America"] var annotationArray =

Binary operator '==' cannot be applied to operands of type '[MKAnnotation]' and 'MKAnnotation'

喜欢而已 提交于 2019-12-25 15:52:28
问题 I'm working on a tvOS app, where I want to be able to swipe between annotations. I store my annotations in a Dictionary, and store the Dictionary in an Array for future use. I am simply plotting three annotations for Canada, USA, and Mexico. I want to be able to swipe on the remote between these annotations. When an annotation is clicked, it will take you to information about that country. let countriesArray = ["Canada", "Mexico", "United States of America"] var annotationArray =

How to show the annotations in a mapView

我与影子孤独终老i 提交于 2019-12-25 08:29:10
问题 I got a question about the MKAnnotations. I want to add to my mapView annotations to draw them with the typical Pin. How can I do it? I've implemented the coordinate getter because coordinate is readonly, and I gave value to the coordinates in that method. If I add the annotations like this: [self.mapView addAnnotations:self.annotations]; Isn't it enough? Because in my mapView don't appear the pins, and I don't know if a have to call some method, or I have to call a setter for the coordinate

Seeing MKAnnotation Coordinates During Drag

女生的网名这么多〃 提交于 2019-12-25 03:14:11
问题 I want to be able to track the coordinates of my MKAnnotation as I drag it. Currently, I am only getting the coordinates as the drag begins. I have tried implementing a custom MKAnnotationView subclass with touchesMoved , however this appears not to work. (As suggested here: Obtaining MKAnnotation's coordinate while dragging.) By receiving the new coordinates as I drag my annotation, I will in turn be able to update my polygon shape. 回答1: You can track the coordinates from MKAnnotationView .

how to add multiple pin at the same lat/long

血红的双手。 提交于 2019-12-25 00:59:00
问题 I am trying to add multiple pin at the same location. for (int i = 0; i < [arrListing count]; i++) { List *obj = [arrListing objectAtIndex:i]; NSLog(@"Title %@",obj.Title); CLLocationCoordinate2D annotationCoord; annotationCoord.latitude = [obj.lat floatValue]; annotationCoord.longitude = [obj.log floatValue]; MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init]; annotationPoint.coordinate = annotationCoord; annotationPoint.title = obj.Title; [mapView addAnnotation

MKMapView custom callOutView with auto layout iOS 6 vs. iOS7

≡放荡痞女 提交于 2019-12-24 18:09:39
问题 Hej Folks, my apps crashes on a MKMapView under iOS 6 if I use auto layout for the callout view. With iOS 7 this works fine. - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view { CustomMapAnnotation *annotation = (CustomMapAnnotation *)view.annotation; if([annotation isKindOfClass:[CustomMapAnnotation class]]) { CustomMapCalloutView *calloutView = [CustomMapCalloutView new]; calloutView.translatesAutoresizingMaskIntoConstraints = NO; calloutView.titleLabel

dynamically change leftCalloutAccessoryView based on the MKAnnotationView that is selected

元气小坏坏 提交于 2019-12-24 15:12:41
问题 I have an array of images, that are associated with each Annotation on my map. I can statically add an image to the leftCalloutAccessoryView but I am unsure how to make this dynamic. I hope its clear what I am asking. Each annotation has its own individual image that I want to display but I am unsure of how to reference the image in the following method; - (MKAnnotationView *)mapView:(MKMapView *)mv viewForAnnotation:(id <MKAnnotation>)annotation { if([annotation isKindOfClass:[MKUserLocation

How to add colored border bubble callout in swift?

流过昼夜 提交于 2019-12-24 11:54:06
问题 I added a right button to callout, but now I'd like add a colored border to the whole bubble/callout. let's say I want the whole bubble with a colored border. I thought to implement something as view?.detailCalloutAccessoryView?.layer.borderWidth = 5.0 view?.detailCalloutAccessoryView?.layer.borderColor = UIColor(red:51/255.0, green:153/255.0, blue:255/255.0, alpha: 1.0).CGColor but it doesn't work something similar to this (I know that here they only aded a red view) but white inside, but

Edit annotation text with an UIAlertViewStylePlainTextInput

孤街浪徒 提交于 2019-12-24 11:43:51
问题 I can drop pin annotations onto a map which has a disclosure button. When that button is clicked an alertView pops up in which I can remove the selected annotation. I am now trying the edit the selected annotation subtitle with UIAlertViewStylePlainTextInput. Any ideas on how I can do this? - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { NSLog(@"Annotation button clicked"); UIAlertView * alert = [[UIAlertView