mkannotation

How to display and connect multiple locations with a route with annotations in an MKMapView inside an iPhone App?

一世执手 提交于 2019-12-12 20:58:42
问题 I need to display a MKMapView with more than 4 locations with different Annotations and a route connecting the locations. I have tried to display the multiple locations inside a MKMapView but i still not able to find out on how to connect the locations with a route. I am also trying to get this checked if i have implemented it in a right way. I have created a "CLLocationCoordinate2D" and then added a lat and long similarly for 4 points. I have created a custom object which implements

Sometimes strange artifact appears when [mapView selectAnnotation];

不问归期 提交于 2019-12-12 17:22:37
问题 [_mapView selectAnnotation:sannotation animated:YES]; It appears not always, so I don't understand what's the reason for it. How to fix it? 回答1: Before selecting any annotation deselect all annotations on mapView. for (id<MKAnnotation> annotation in mapView.annotations) [mymap deselectAnnotation:annotation animated:NO]; I had same issue when along with default callout, I had implemented custom callouts. Though it is not a perfect solution it served the purpose. 来源: https://stackoverflow.com

How to Show Multiple Annotation in MKMapView iOS?

試著忘記壹切 提交于 2019-12-12 09:45:48
问题 i am newbie in iOS Development i want to Show multiple Annotation in MKMapViewController in iOS for that i write a code as in my viewDidLoad method - (void)viewDidLoad { [super viewDidLoad]; self.mapView.delegate=self; NSArray *name=[[NSArray alloc]initWithObjects: @"VelaCherry", @"Perungudi", @"Tharamani", nil]; self.annotation=[[NSMutableArray alloc]initWithCapacity:[name count]]; MKPointAnnotation *mappin=[[MKPointAnnotation alloc]init]; CLLocationCoordinate2D location; location.latitude=

Prevent touch events on MKMapView being detected when a MKAnnotation is tapped

荒凉一梦 提交于 2019-12-12 09:43:18
问题 I have a UITapGestureRecognizer that will hide and show a toolbar over my MKMap when the user taps the Map - simple. However, when the user taps on an MKMapAnnotation, I do not want the map to respond to a tap in the normal way (above). Additionally, when the user taps elsewhere on the map to de-select an MKAnnotation callout, I also don't want the toolbar to respond. So, the toolbar should only respond when there are no MKAnnotations currently in selected state. Nor should it respond when

How to Hide MKAnnotationView Callout?

假如想象 提交于 2019-12-12 07:45:09
问题 i'm trying to hide an AnnotationView without touching the pin, is the possible? Thanks! for (id currentAnnotation in self.mapView.annotations) { if ([currentAnnotation isKindOfClass:[MyAnnotation class]]) { } } 回答1: Do you just want to make the callout bubble go away but keep the pin? If yes, then do this: for (id currentAnnotation in self.mapView.annotations) { if ([currentAnnotation isKindOfClass:[MyAnnotation class]]) { [self.mapView deselectAnnotation:currentAnnotation animated:YES]; } }

how to store information related of a pin in MKPinAnnotation

依然范特西╮ 提交于 2019-12-12 05:54:46
问题 actually, i have retrieved a lot of informations about service stations from web-service, they are here, i displayed for each Station a pin annotation to show it on the Map with a UIButtonTypeDetailDisclosure , now i want to store for each pin some additional informations like : float lng = [[stationEnCours objectForKey:@"ssiphone_longitude"] floatValue];//that's how i retrieve it from web-service float lat = [[stationEnCours objectForKey:@"ssiphone_latitude"] floatValue];//that's how i

How Do I Determine Which MKAnnotation is clicked?

亡梦爱人 提交于 2019-12-12 05:50:00
问题 I'm a noob to iphone developoment and i am trying to determine the int value of an annotation so I can then take that int value and cross reference it to an array to get a corresponding value. However, when i try to get the int value with the .tag method the value always returns as zero. If I have 5 annontations I need to be able to determine which annontation is 0,1,2,3 and 4. Any help is greatly appreciated. MY CODE - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:

How to change annotation callout button color in iphone?

血红的双手。 提交于 2019-12-12 02:16:24
问题 I want to change the above blue color callout button to gray. How to do this?? Also is this possible to make whole annotation bubble clickable??? Can anyone suggest me the method. 回答1: You are probably adding the blue button something like this - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{ MKPinAnnotationView *annView=(MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"annViewIdentifier"]; if (annView == nil) {

How to add distance to pin of an MKAnnotation?

≡放荡痞女 提交于 2019-12-11 23:21:56
问题 Ive got an app that plots mkannotations (i hope i get my terminology right...its kinda confusing) on a mapview. I have already included the subtitle for when you tap on them. I have been looking online for a way to include the distance in those callouts but im not quite there yet. I ran across two partial solutions and Im wondering if they should be combined. First, I didnt have CoreLocation added to my project, I need it right? To be constantly updating my user location and be able to