mkpinannotationview

How to update information on MKPinAnnotationView?

坚强是说给别人听的谎言 提交于 2019-12-09 06:49:25
I've had some past experience using MKMapView and MKPointAnnotation , which I used to put some pin on a map. This time I am trying to go one step further and use MKPinAnnotationView , to write a label along with some of the pins. Unfortunately, it doesn't all work as I expect. Here is what I want to do: I have a map (an MKMapView object) and when I touch it, I put a pin at the touch point, then some computation is performed and this gives me a second point on the map. I put a second pin on the map (located at the second point), on this last pin I want to put a label, say "Hello Second!", but

showsUserLocation returns pin instead of blue dot in iPhone simulator

喜你入骨 提交于 2019-12-07 09:56:53
问题 This is my -mapView:viewForAnnotation method which drops pins when i create annotation views. But when i set mapView.showsUserLocation = YES; in -viewDidLoad , i get a pin dropped on Infinite Loop (expected - in simulator) and not the normal blue dot. - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{ MKAnnotationView *anno = nil; //create a pin annotation view MKPinAnnotationView *pin=[[[MKPinAnnotationView alloc] initWithAnnotation

iOS 6 maps- not animating PIN drop

拟墨画扇 提交于 2019-12-06 04:42:05
I have created a custom MKAnnotation class and it has been working - until iOS 6 came out. Since then my pins get added to the apple map but now without a drop animation! Is this how it is set or there maybe an an issue with the way I'm doing things. I have set a delay of 1 sec until the method that adds the annotations to the map is called, so I can see if the drop animations are actually occurring before the view appears - still, the pins just appear out of nowhere without dropping. Here's the code I'm using: -(MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(Annotation*

Dragging the map after dragging my MKAnnotationView does not move the MKAnnotationView with it

荒凉一梦 提交于 2019-12-04 03:14:42
MKPinAnnotationView does not allow you to use a custom image as 'pin' and enable dragging at the same time, because the image will change back to the default pin as soon as you start dragging. Therefore I use an MKAnnotationView instead of an MKPinAnnotationView. While using MKAnnotationView instead of MKPinAnnotationView does keep your custom image shown as your 'pin' it doesn't support the drag & drop animation that you get with the default pin. Anyway, my issue is that after I drag my custom MKAnnotationView to a new point on the map and then move the map itself the MKAnnotationView does

MapView Custom Pin Image Issue

雨燕双飞 提交于 2019-12-03 21:20:47
I have changed my MapView pin image but I am getting this problem that some of the point wont change the pin image and some of them change. Where would be the problem? I have added an example. My Code: - (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation { MKPinAnnotationView *pinAnnotation = nil; MKAnnotationView *pinView = nil; if(annotation != locationMap.userLocation) { static NSString *defaultPinID = @"myPin"; pinAnnotation = (MKPinAnnotationView *)[locationMap dequeueReusableAnnotationViewWithIdentifier:defaultPinID]; if ( pinAnnotation == nil )

Add image behind MKPinAnnotationView

百般思念 提交于 2019-12-03 10:17:39
问题 I'm trying to add an image behind a MKPinAnnotationView. Seems like it should be rather easy to just do this in here: - (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views { for (MKAnnotationView *aView in views) [[aView superview] addSubview:imageView]; } But the problem I am having in doing that is that the child subview to the pin will render on top of it not BEHIND it. I have also tried: for (MKAnnotationView *aView in views) [[aView superview] insertSubview

Custom MKPinAnnotation callout bubble similar to default callout bubble

与世无争的帅哥 提交于 2019-12-02 12:19:44
问题 i want to create a custom callout bubble on MKMapView. But i want to create the call out bubble in the same manner of default bubble. So how to create a View look like annotaion in this image (source: objectgraph.com) I want a custom custom view which look like "Parked Location" annotaion in the following image. with custom width, height etc. P I am not able to add required details in Default bubble. Thats why am creating custom bubble. Plz help me..thanks.. 回答1: I have developed a custom

MKPinAnnotationView color is not working

孤街浪徒 提交于 2019-12-02 04:11:59
I am trying to show some pins from an array, it shows them all but they are red, and not green as i ask them to be. Why is that ? //run on array to get all locations for(int k=0;k<[array count];k=k+2) { float targetlat=[[array objectAtIndex:k] floatValue]; float targetlongi=[[array objectAtIndex:k+1] floatValue]; CLLocationCoordinate2D location = CLLocationCoordinate2DMake(targetlat,targetlongi); NSString *partyTitle = @"title"; MKPinAnnotationView *partyPin = [self returnPointView:location andTitle:partyTitle andColor:MKPinAnnotationColorGreen]; [self.mapView addAnnotation:partyPin.annotation

EXC_BAD_ACCESS with MKPinAnnotationView

隐身守侯 提交于 2019-12-01 21:13:39
I have a problem displaying my MKPinAnnotationView on the mapView in iOS. I get this error but i don't understand where the error comes from : "EXC_BAD_ACCESS". My code seems good : -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { MKPinAnnotationView *pv = [[MKPinAnnotationView alloc] init]; [pv setPinColor:MKPinAnnotationColorGreen]; [pv setCanShowCallout:YES]; [pv setRightCalloutAccessoryView:[UIButton buttonWithType:UIButtonTypeDetailDisclosure]]; return pv; } When i set breakpoints to the application, here is my console display using gdb:

Changing pin color MKMapView

与世无争的帅哥 提交于 2019-12-01 03:51:56
I add annotations to my map in this way: MyAnnotation *annotationPoint2 = [[MyAnnotation alloc] init]; annotationPoint2.coordinate = anyLocation; annotationPoint2.title = [NSString stringWithFormat:@"%@", obj]; annotationPoint2.subtitle = @""; //or set to nil annotationPoint2.keyValue = [NSString stringWithFormat:@"%@", key]; [mapPins addAnnotation:annotationPoint2]; The pins are all red, and I would like them all green. How can I change the color? I have tried the following, but it still gives a red mark: annotationPoint2.pinColor = MKPinAnnotationColorGreen; - (MKAnnotationView *) mapView: