mkannotation

Edit annotation text with an UIAlertViewStylePlainTextInput

孤街浪徒 提交于 2019-12-24 11:43:51
问题 I can drop pin annotations onto a map which has a disclosure button. When that button is clicked an alertView pops up in which I can remove the selected annotation. I am now trying the edit the selected annotation subtitle with UIAlertViewStylePlainTextInput. Any ideas on how I can do this? - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { NSLog(@"Annotation button clicked"); UIAlertView * alert = [[UIAlertView

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");

How to add callout into individual annotation in map view

房东的猫 提交于 2019-12-24 04:15:15
问题 I'm trying to set each annotation with different callout detail info. Currently when I click on any annotation location, it shows all the callout info. #import "AnnotationViewController.h" #import "Annotation.h" @implementation AnnotationViewController @synthesize mapView; -(void)viewDidLoad { [super viewDidLoad]; [mapView setMapType:MKMapTypeStandard]; [mapView setZoomEnabled:YES]; [mapView setScrollEnabled:YES]; [mapView setDelegate:self]; MKCoordinateRegion TT = { {0.0, 0.0} , {0.0, 0.0} }

How to save the selected MKAnnotation?

久未见 提交于 2019-12-23 19:35:53
问题 I have an app that has a mapview, and it shows 20 pins (from an Array) on the map. When the user clicks on it, it can show a bubble with a right accessory button. Here come my problem: How do I know which pin was pressed? I heard something about the mapView:didSelectAnnotationView method, but I don't really understand how do you get the pin/callout index, so that I can get the information of the object at the same index of my Array? Thanks for any help! 回答1: When that method gets called --

Loading Annotations to Map View From Plist Not Working

浪子不回头ぞ 提交于 2019-12-23 05:11:40
问题 Hey fellas, so I am able to display annotations (2) from the source code found at this link (and within the commented-out code post below). However, I load annotation information from a plist and load it correctly (confirmed via debugger) into mapView but for some reason the annotations refuse to show when I run the app in the simulator. Here is the relevant code: Annotation header: #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface ArboretumAnnotation : NSObject

Loading Annotations to Map View From Plist Not Working

六眼飞鱼酱① 提交于 2019-12-23 05:10:33
问题 Hey fellas, so I am able to display annotations (2) from the source code found at this link (and within the commented-out code post below). However, I load annotation information from a plist and load it correctly (confirmed via debugger) into mapView but for some reason the annotations refuse to show when I run the app in the simulator. Here is the relevant code: Annotation header: #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface ArboretumAnnotation : NSObject

showsUserLocation does not display blue dot in iPhone 4.0

核能气质少年 提交于 2019-12-23 02:52:11
问题 So, I've created a CLLocationManager, called it to start updating, set mapView.showsUserLocation to YES, and returned nil for the userLocation annotation. Here are some snippets from my code in my UIMapViewController: - (void)viewDidLoad { CLLocationManager *locationManager = [[CLLocationManager alloc] init]; [locationManager startUpdatingLocation]; } - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {

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

Change MKMapType in MKMapView and keep custom pinImage for annotations

元气小坏坏 提交于 2019-12-22 10:29:49
问题 I have set a custom pinImage for my annotations and when I change the type to MKMapTypeHybrid it reverts the pinImage setting to the standard pins. I'm setting the mapType in my viewWillAppear method of the map view controller. I'm setting my pinImage for the annotations like so (shortened for clarity): - (MKAnnotationView *) mapView:(MKMapView *) mapView viewForAnnotation:(id ) annotation { MKPinAnnotationView *customAnnotationView=[[[MKPinAnnotationView alloc] initWithAnnotation:annotation