mkpinannotationview

MKPinannotation detail disclosure button - present new view

 ̄綄美尐妖づ 提交于 2019-11-30 05:25:48
FirstViewController.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface TransparentToolbar : UIToolbar{ } @end @interface AddressAnnotation : NSObject <MKAnnotation> { CLLocationCoordinate2D coordinate; NSString *title; NSString *subTitle; NSString *directions; NSString *website; } @property (nonatomic,retain) NSString *title; @property (nonatomic,retain) NSString *subtitle; @property (nonatomic,retain) NSString *directions; @property (nonatomic,retain) NSString *website; @end @interface FirstViewController : UIViewController { IBOutlet MKMapView *mapView; //stores go here! /

Custom MKAnnotationView Callout [duplicate]

十年热恋 提交于 2019-11-29 08:02:06
Possible Duplicates: Custom MKPinAnnotation callout bubble similar to default callout bubble How to customize the callout bubble for MKAnnotationView? Does anyone know, or have code that shows, how to create a custom MKAnnotationView Callout? I mean the actual text bubble and not the pin. Thanks in advance. you cannot make a custom MKAnnotationView, you can only custom the callout views left and right, it's just a view, so you can put anything you want. If you want a custom MKAnnotationView you will need to capture the touch and handle the rest. 来源: https://stackoverflow.com/questions/1350050

MKPinannotation detail disclosure button - present new view

天涯浪子 提交于 2019-11-29 03:46:58
问题 FirstViewController.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface TransparentToolbar : UIToolbar{ } @end @interface AddressAnnotation : NSObject <MKAnnotation> { CLLocationCoordinate2D coordinate; NSString *title; NSString *subTitle; NSString *directions; NSString *website; } @property (nonatomic,retain) NSString *title; @property (nonatomic,retain) NSString *subtitle; @property (nonatomic,retain) NSString *directions; @property (nonatomic,retain) NSString *website; @end

Using MKAnnotationView without MKMapView?

北城以北 提交于 2019-11-29 02:25:56
I'm wondering if it's possible to use the MKAnnotationView inside a UIView other than MKMapView? I'm trying to find an alternative to using the undocumented UICalloutView class. I can create the MKAnnotationView and add it to my view, but I can't get it to show. To anyone interested: I ported the code of Ed Anuff to Objective C. The source is complete with an Example. You can download it here . Maybe Ed can check it (I hope I did not do too many mistakes) and add it to his git repository. This is a work-alike CalloutView implemented in MonoTouch, if someone creates an Obj-C version, let me

MKMapView refresh after pin moves

自闭症网瘾萝莉.ら 提交于 2019-11-28 21:40:56
A custom AnnotationView is updated with new coordinates. But the problem is that it visually updates only after some manipulations with MKMapView, e.g. zooming or moving. What should I do to manually update visual position on a map? PS. I've tried to change region to current map's region. But it does change zoom. It's strange. [mapView setRegion:[mapView region] animated:YES]; I am a little shoked after hours of research. The answer is just: [mapView setCenterCoordinate:mapView.region.center animated:NO]; Do not ask me why, but it updates a mapview and it's what i was need. MKMapView observes

iPhone MapKit: Annotation images get reset back to pins

拟墨画扇 提交于 2019-11-28 08:22:53
问题 I'm adding several annotations to a MapView and using a custom image instead of the default pins. I am using the viewForAnnotation delegate method to set the custom image like this: view.image = [UIImage imageNamed:@"placemark.png"]; And I've also tried: [(MKPinAnnotationView *)view setImage:[UIImage imageNamed:@"placemark.png"]]; Now, these both set the image just fine. But when an annotation is either tapped or the mapType changes to Satellite or Hybrid, it resets back to the red pin image.

MKPinAnnotationView custom Image is replaced by pin with animating drop

喜你入骨 提交于 2019-11-28 00:57:21
I'm displaying user avatar images on a MapView. The avatars appear to be working if they are rendered without animation, however I'd like to animate their drop. If I set pinView.animatesDrop to true, then I lose the avatar and it is replaced by the pin. How can I animate the drop of my avatar without using the pin? Here is my viewForAnnotation method I'm using: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { if ([annotation isKindOfClass:[MKUserLocation class]]) return nil; MKPinAnnotationView* pinView = (MKPinAnnotationView*)[self.mapView

Z-ordering of MKAnnotationViews

半世苍凉 提交于 2019-11-27 20:44:13
I'm getting fairly frustrated with the limitations of MKMapKit. My current problem has to do with the z-ordering of annotation views, particularly as it relates to touches. If you accept the default z-order the mapkit gives you: The order appears random. The z-order is unrelated to the order the annotations were added. If one annotation ends up on top of another one, touching the top annotation generally brings up the callout for the bottom annotation. It seems like the hit detecting doesn't even respect the draw order. What's up with that? I've tried solving #1 using something similar to the

Using MKAnnotationView without MKMapView?

泄露秘密 提交于 2019-11-27 16:42:38
问题 I'm wondering if it's possible to use the MKAnnotationView inside a UIView other than MKMapView? I'm trying to find an alternative to using the undocumented UICalloutView class. I can create the MKAnnotationView and add it to my view, but I can't get it to show. 回答1: To anyone interested: I ported the code of Ed Anuff to Objective C. The source is complete with an Example. You can download it here. Maybe Ed can check it (I hope I did not do too many mistakes) and add it to his git repository.

How to capture Tap gesture on MKMapView

孤街浪徒 提交于 2019-11-27 06:45:01
I am trying to capture tap event on my MKMapView , this way I can drop a MKPinAnnotation on the point where user tapped. Basically I have a map overlayed with MKOverlayViews (an overlay showing a building) and I would like to give user more information about that Overlay when they tap on it by dropping a MKPinAnnotaion and showing more information in the callout. Thank you. You can use a UIGestureRecognizer to detect touches on the map view. Instead of a single tap, however, I would suggest looking for a double tap ( UITapGestureRecognizer ) or a long press ( UILongPressGestureRecognizer ). A