mkmapview

Multiple MKPolyline on MKMapView iOS6

别等时光非礼了梦想. 提交于 2019-12-20 05:55:23
问题 I am working with MKMapView to draw route using MKPolyline , I am able to draw single route with an array of waypoints.Now I want to draw multiple MKPolyline s on the MKMapView for instance, A blue MKPolyline from 28.102021, 77.10129 to 28.20320, 77.3021 and A red MKPolyline from 28.50930, 77.89192 to 28.60291, 77.87328 . How can I achieve this ? Code: - (void)viewDidLoad { [super viewDidLoad]; locationManager = [[CLLocationManager alloc] init]; locationManager.desiredAccuracy = 6.0;

On mkuserlocation, how do I show my own custom message in viewForAnnotation

可紊 提交于 2019-12-20 05:49:16
问题 I want to show a custom message instead of "My Location" in viewForAnnotation. How do I do this? Thanks Deshawn 回答1: In the delegate of your MKMapView , implement the method mapView:viewForAnnotation and check if the annotation is of type MKUserLocation . If yes, change the title and subtitle properties of the annotation. The callout will automatically pull the new values. Or you can create a totally new view and return it here. - (MKAnnotationView *)mapView:(MKMapView *)mapView

Drawing route partially not getting required output in iPhone MapView

柔情痞子 提交于 2019-12-20 05:46:51
问题 I am trying to draw route between two points using polyline . I got somewhat route but not correct and I think it will get confused at the turn . I am using google api for getting points of route .Following is code what i tried please check . - (IBAction)onclickDrawButton:(id)sender { flag=TRUE; NSString *startpoint=[satrtTextfield text]; NSString *endpoint=[endTextfield text]; NSMutableString *urlString=[NSMutableString stringWithFormat:@"http://maps.googleapis.com/maps/api/directions/json

iOS set MKMapView camera heading rotation around anchor point

和自甴很熟 提交于 2019-12-20 04:55:31
问题 I have a MKMapView that I am trying to rotate around the bottom center of itself. I have a simple method that gets the users magnetometer heading and changes the camera view of the map to the heading, this works just fine. My problem though is setting the anchor point on the map in lat/long that the map will rotate around. I can get set my desired point to be the bottom of my map with this method: -(void)setMapCenterFromLocation:(CLLocationCoordinate2D)location { MKCoordinateRegion oldRegion

Fitting annotations on a MKMapView while keeping user position centered

我的梦境 提交于 2019-12-20 04:54:20
问题 I'm trying to fit all annotations on my MKMapView while keeping the current user position in center of map. There are already many references[1][2] on how to zoom out a region to fit annotations on the map but they will adjust the current center position e.g. if all annotations are located east of my current user position, it will adjust so the current user position is moved left of the map. How can I zoom my map out so it will fit all annotations shown but keep the users current position in

Using AVSpeechSynthesizer to read a description of location on a Map

大城市里の小女人 提交于 2019-12-20 04:31:09
问题 My map has 4 or 5 points close to each other and right now using AVSpeechSynthesizer I've got it so that it will say the name of the location (which is also displayed in a little bubble). I want it to still show that bubble but when clicked I want it to say a description of that place that I would have specified. This is my code at the moment: MapViewAnnotation.h @interface MapViewAnnotation : NSObject <MKAnnotation> { NSString *title; CLLocationCoordinate2D coordinate; NSString *desc; }

MKPinAnnotationView color is not working

 ̄綄美尐妖づ 提交于 2019-12-20 04:30:34
问题 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

Regarding Apple's KMLViewer placemarkDescription and annotation subtitle

会有一股神秘感。 提交于 2019-12-20 04:23:14
问题 In my app I am using Apple's KMLViewer to show annotations that I get from a KML file.In the file KMLParser.m, there is an instance variable, placemarkDescription that converts the information under Description tags from kml file to annotation subtitle.Now, in my file every annotation has the information stored under Description in this way: <table width="280px"><tr><td></td><td></td></tr></table><table width="280px"><tr><td><b>Fitness Bulls</b>---Palester sportive. Sporti dhe koha e lire....

How can I get a finer grained span in my MKMapView

僤鯓⒐⒋嵵緔 提交于 2019-12-20 03:42:27
问题 I'm using an MKMapView and I'm initializing like this: homeLocation.latitude = 42.033126; homeLocation.longitude = -70.168621; [self.mapView setCenterCoordinate:homeLocation animated:NO]; MKCoordinateRegion viewRegion; viewRegion.center = homeLocation; viewRegion.span = MKCoordinateSpanMake(1.7, 1.7); [self.mapView setRegion:[self.mapView regionThatFits:viewRegion] animated:NO]; and here is my app That's fine, except for my app I need to have it zoomed out a tiny bit more. But when I try this

Maps and legal mention

强颜欢笑 提交于 2019-12-20 03:38:35
问题 With iOS < 6.0 we were able to re-position the "Google" link over map view (by browsing the subviews of map view). Now with iO6, there's a "legal" link and this is a MKAttributeLabel. A private class that we can't manipulate ... My problem is that I must add a footer subview to my map and it'll hide the legal link ... How can I solve this problem without any App Store rejection ? Can I create another legal button my self and add it where I want in my map view ? I have no idea what I'm able to