mkannotationview

setting up Image in MKAnnotationPinView

烈酒焚心 提交于 2019-12-24 09:36:04
问题 I have the following code inside the delegate: - (MKAnnotationView *)mapView:(MKMapView *)aMapView viewForAnnotation:(id <MKAnnotation>)anAnnotation { MKPinAnnotationView *pin = (MKPinAnnotationView *) [map dequeueReusableAnnotationViewWithIdentifier: @"RoutePin"]; if (pin == nil) { if ([anAnnotation isKindOfClass:[RouteMapAnnotation class]]) { RouteMapAnnotation *theAnnotation = (RouteMapAnnotation *)anAnnotation; if (theAnnotation.identifier == @"routePin") { //NSLog(@"TESTING PART III");

Draggable Pin does not have a fixed position on map

我们两清 提交于 2019-12-24 03:29:28
问题 Currently I am implementing a feature, where the user can correct manually a pin on the map. I have set the annotationView to annotationView.draggable = YES; and I have also implemented the delegate method to receive the new coordinates. But how can I now tell the mapView that the dragging action should stop now and the pin gets its fixed position on the map, even if the map is then moved. The current behaviour is that after the dragging of the pin to a new position, if I then move the map,

Set MKPinAnnotationColorRed just for the first and last MKAnnotation on MKMapView

我的梦境 提交于 2019-12-24 03:19:05
问题 I've an NSArray of custom MKAnnotation , i need to set a red pin color for the first/last annotation, otherwise set a green pin. The program does not behave as i want, the green pins are associated each time with two different annotations in a random way, are not associated with the first and the last as i want. So, this is what i'm doing in my controller: - (void)viewDidLoad { [super viewDidLoad]; //load set a coords from file etc... //self.coordinates is the array of annotations [self.myMap

Add Labeltext on Mkannotation image

南笙酒味 提交于 2019-12-24 03:07:13
问题 I am using a MKMapView with custom placeMark, it has a NSString value and i'll like to add it as label to the mkannotationview image. - (MKAnnotationView *)mapView:(MKMapView *)MapView viewForAnnotation:(MyPlaceMark *)annotation{ static NSString* AnnotationIdentifier = @"AnnotationIdentifier"; MKAnnotationView* MyView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier] autorelease]; MyView.canShowCallout=YES; MyView.image = [UIImage imageNamed:@

MKAnnotation not responding on tap

痞子三分冷 提交于 2019-12-23 23:13:39
问题 I am displaying several pins on map just like this: for (int i = 0; i < points.count; i++) { if([[[points objectAtIndex:i] objectForKey:@"lat"] class] != [NSNull class]) { southWest.latitude = MAX(southWest.latitude , [[[points objectAtIndex:i] objectForKey:@"lat"] doubleValue]); southWest.longitude = MIN(southWest.longitude, [[[points objectAtIndex:i] objectForKey:@"lon"] doubleValue]); northEast.latitude = MIN(northEast.latitude, [[[points objectAtIndex:i] objectForKey:@"lat"] doubleValue])

iOS7 style mapview callout segue in the callout (calloutAccessoryControlTapped, UIButtonTypeDetailDisclosure)

◇◆丶佛笑我妖孽 提交于 2019-12-23 18:11:05
问题 I have mapview on iPad with annotations and callouts, each callout also has rightCalloutAccessoryView with detail disclosure button. I see the stock Maps app performs segue for callout details within the callout's object. It first performs a transition of the view from right to left like a push segue, then resizes the callout frame based on the detail's content. How should I configure the segue in storyboard to be performed within the original callout and not replace the entire screen? Is it

Having trouble passing UIImage to MKPinAnnotationView

こ雲淡風輕ζ 提交于 2019-12-23 03:07:26
问题 I subclassed MKPointAnnotation and added a NSString and a UIImage so I can pass these elements to an MKPinAnnotationView . The string passes into the MKPinAnnotationView fine, but the image attribute is coming through as null. I can't figure out why. I will say that one time running this code on my phone the image appeared on a pin once, so maybe I have a memory leak? The other 1000 times I've compiled the images show as null in the log and do not appear. Any help is appreciated. Here is my

MapKit Display Annotation Clusters and Along With Non-Clustered Annotations

折月煮酒 提交于 2019-12-22 13:02:32
问题 I am new to iOS development and currently using the FBAnnotationClusteringSwift to cluster makers. My app needs to have two annotations which will not be clustered, as they indicate the source and destination addresses. The remaining annotations must be clustered as they represent stations . What I want to achieve is something like the image bellow, where "A" is my source address, and the clusters represent stations: However what is happening is, as the clusters are created , the Annotation

MapKit Display Annotation Clusters and Along With Non-Clustered Annotations

半腔热情 提交于 2019-12-22 13:02:15
问题 I am new to iOS development and currently using the FBAnnotationClusteringSwift to cluster makers. My app needs to have two annotations which will not be clustered, as they indicate the source and destination addresses. The remaining annotations must be clustered as they represent stations . What I want to achieve is something like the image bellow, where "A" is my source address, and the clusters represent stations: However what is happening is, as the clusters are created , the Annotation

MKAnnotationView custom image is not shown

北城余情 提交于 2019-12-22 11:10:50
问题 I am trying to add a custom image instead of the regular pin on the map. But it remains a red pin... What am I missing? - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{ static NSString* AnnotationIdentifier = @"AnnotationIdentifier"; MKPinAnnotationView *annView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier]; annView.animatesDrop = TRUE; annView.image = [UIImage imageNamed:@"CustomPin.png"