mkannotationview

Detect Tap on CalloutBubble in MKAnnotationView

ぃ、小莉子 提交于 2019-11-27 01:47:46
问题 Im working with MKMapView and MKAnnotationView. I have an annotation in the map. When the users tap on it, the callOut Bubble is displayed. When the annotation is tapped again ( and the callOut Bubble is visible ) i need to change to another view. How can i detect the second tap, or the tap in the bubble? 回答1: Could you add a gesture recognizer when you're initializing the MKAnnotationView ? Here's the code for inside dequeueReusableAnnotationViewWithIdentifier: UITapGestureRecognizer

Resize MKAnnotationView Image When map zooms in and out?

你说的曾经没有我的故事 提交于 2019-11-27 01:25:33
问题 What i have I have about 150 MKAnnotationViews on a map. Every MKAnnotationView has an image that replaces the default pin. What's happening now When the map zooms in, the MKAnnotationViews are getting smaller and the opposite when it zooms out. What I wish Happened Well i want it to be the other way around. Since when the map is small I wish that the MKAnnotationViews will be smaller so the user can see all of them, and when he zooms in I wish they will be bigger. What code I have so far I

Customize the MKAnnotationView callout

纵饮孤独 提交于 2019-11-26 23:24:23
I want to create a custom MKAnnotationView callout as shown in this image. I have tested several solutions but they only allow customization of the left/right images and title/subtitle. Can anybody please give me some source code or tutorial link for it? Currently I am clueless. Please help. Jano I understand you want a pin with a custom callout. We can't create a custom callout, but we can create an annotation with a completely customized view. So the trick is to add a second annotation when the first is selected, and make the 2nd annotation view look like a callout bubble. This is the

MKAnnotation image offset with custom pin image

懵懂的女人 提交于 2019-11-26 22:39:31
问题 I have a MKAnnotation with an custom pin image. However the pin(MKAnnotationView) centers the image in relation to the specified coordinate. I want to set the point of the coordinate at the bottom center of the image, not center. I've tried using annView.centerOffset = CGPointMake(-12, -28); . But the problem is that centerOffset isn't relevant to the maps zoom level. One can do this both in the JS API and in Android. Is there any possibility to do this in objective-c? ..fredrik 回答1: Your

Learn about the NSXMLParser in iOS

眉间皱痕 提交于 2019-11-26 20:21:14
问题 I learn about current NSXMLParser. I read many tutorials but none could tell me exactly how it works. there is a tutorial on StackOverflow? My problem is this KML read structur in my app and display with MKMapView My Parser class looks like: #import <Foundation/Foundation.h> @interface Parser : NSXMLParser @property (nonatomic, strong) NSString *rowElementName; // this is the element name that identifies a new row of data in the XML @property (nonatomic, strong) NSArray *attributeNames; //

How to create Custom MKAnnotationView and custom annotation title and subtitle

好久不见. 提交于 2019-11-26 20:17:39
I need to create above Annotation view on MKMapView. I am able to create the custom annotation view but on the tap of annotation the view need to be opened image with that big text, I am not able to create that one. Please provide me some links or the way to do this task. Rob To create a custom annotation view (your replacement for the standard pin), you can just set the image property of the MKAnnotationView in the viewForAnnotation method: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { if ([annotation isKindOfClass:[MKUserLocation class]]

Swift different images for Annotation

谁说胖子不能爱 提交于 2019-11-26 14:25:46
I managed to get a custom icon for a annotation pin in Swift, but now I am still stuck using 2 different images for different annotations. Right now a button adds a annotation to the map. There should be another button that also adds a annotation but with another icon. Is there a way to use the reuseId for this? class ViewController: UIViewController, MKMapViewDelegate { @IBOutlet weak var Map: MKMapView! @IBAction func btpressed(sender: AnyObject) { var lat:CLLocationDegrees = 40.748708 var long:CLLocationDegrees = -73.985643 var latDelta:CLLocationDegrees = 0.01 var longDelta

Button action in mkannotation view not working?

杀马特。学长 韩版系。学妹 提交于 2019-11-26 14:25:40
问题 Hello i have stuck in one situation on map where i have managed to show custom annotation. When the annotation is tapped i have to show a view with some information and one button. when user taps on the button then one alert should display. code is as follows - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view { if (![view.annotation isKindOfClass:[MKUserLocation class]]) { POCustomAnnotation *annotation = (POCustomAnnotation *)[view annotation]; UIView

Swift - Add MKAnnotationView To MKMapView

痞子三分冷 提交于 2019-11-26 10:58:34
问题 I\'m trying to add MKAnnotationView to MKMapView but I can\'t do it… Can anyone help me? Here is my code: override func viewDidLoad() { super.viewDidLoad() locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.startUpdatingLocation() var latitude:CLLocationDegrees = locationManager.location.coordinate.latitude var longitude:CLLocationDegrees = locationManager.location.coordinate.longitude var homeLati: CLLocationDegrees = 40.01540192 var homeLong: CLLocationDegrees = 20

How do I animate MKAnnotationView drop?

随声附和 提交于 2019-11-26 10:31:41
问题 I have a custom MKAnnotationView where I set my image myself in viewForAnnotation. How do I animate it\'s drop like I can with MKPinAnnotationView? My code is - (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation { static NSString *AnnotationViewID = @\"annotationViewID\"; MKAnnotationView *annotationView = (MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationViewID]; if (annotationView == nil) { annotationView = [[