mkmapview

IOS 7 - add overlay crash app

家住魔仙堡 提交于 2019-12-24 09:49:58
问题 I am in a process of moving my app to IOS 7 . I have a map and on that map I draw MKPolyLine . Everything worked until IOS 7 now app crash. I have changed viewForOverLay with new method: - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id < MKOverlay >)overlay { if ([overlay isKindOfClass:[MKPolyline class]]) { MKPolyline *route = overlay; MKPolylineRenderer *routeRenderer = [[MKPolylineRenderer alloc] initWithPolyline:route]; routeRenderer.strokeColor = [UIColor

Stop MKMapView from reloading

心已入冬 提交于 2019-12-24 09:19:02
问题 I have a MKMapView with scrolling and userInteraction disabled within a UITableViewCell . The desired effect (effectively a static image of the map in a certain position) works really well but when the MKMapView drifts on and off screen (scrolling) it reloads the map, which occasionally causes the app to crash. I have loaded the custom UITableViewCell in like any other UITableViewCell in cellForRowAtIndexPath : if(indexPath.section == 0 && indexPath.row == 0) { MapTableViewCell *cell =

Calculate bearing in MKMapView gives wrong value while crossing 180 meridian

徘徊边缘 提交于 2019-12-24 08:42:05
问题 I need to draw lines to demonstrate transportation of goods on apple maps. To clarify start- and end-point, I draw a little arrowhead on the destination side.The arrowhead is drawn separately but it is reversed in one case. >-->-->-->- instead of <--<--<--<- I am using MKMapView and MKPolyline to draw lines. I am using MKOverlay to add direction arrows. The steps I follow are, calculate bearing of Source : CLLocationCoordinate2D(latitude: -33.8392932, longitude: 151.21519799999999)

Calculate bearing in MKMapView gives wrong value while crossing 180 meridian

别等时光非礼了梦想. 提交于 2019-12-24 08:40:06
问题 I need to draw lines to demonstrate transportation of goods on apple maps. To clarify start- and end-point, I draw a little arrowhead on the destination side.The arrowhead is drawn separately but it is reversed in one case. >-->-->-->- instead of <--<--<--<- I am using MKMapView and MKPolyline to draw lines. I am using MKOverlay to add direction arrows. The steps I follow are, calculate bearing of Source : CLLocationCoordinate2D(latitude: -33.8392932, longitude: 151.21519799999999)

Remove MKAnnotationView Default Callout From View

北战南征 提交于 2019-12-24 06:47:35
问题 I am trying to prevent MKMapKit from presenting the default annotation callout when tapping on a marker displayed on a MKMapView without blocking the delegate call / interaction of the annotation (seen below). - (void)mapView:(MKMapView *)mapView didSelectAnnotation:(MKAnnotationView *)view { // Custom callout initialized & presented here . . . } I understand you may disable the callout from showing entirely someAnnotationView.canShowCallout = NO; or (more of a hackish approach) not setting

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} }

Draggable Pin does not have a fixed position on map

我们两清 提交于 2019-12-24 03:29:28
问题 Currently I am implementing a feature, where the user can correct manually a pin on the map. I have set the annotationView to annotationView.draggable = YES; and I have also implemented the delegate method to receive the new coordinates. But how can I now tell the mapView that the dragging action should stop now and the pin gets its fixed position on the map, even if the map is then moved. The current behaviour is that after the dragging of the pin to a new position, if I then move the map,

Set MKPinAnnotationColorRed just for the first and last MKAnnotation on MKMapView

我的梦境 提交于 2019-12-24 03:19:05
问题 I've an NSArray of custom MKAnnotation , i need to set a red pin color for the first/last annotation, otherwise set a green pin. The program does not behave as i want, the green pins are associated each time with two different annotations in a random way, are not associated with the first and the last as i want. So, this is what i'm doing in my controller: - (void)viewDidLoad { [super viewDidLoad]; //load set a coords from file etc... //self.coordinates is the array of annotations [self.myMap

iOS 6 MKMapView Memory Leak and Crashes app after some time

喜你入骨 提交于 2019-12-24 02:14:48
问题 iOS 6 MKMapView seems to be using the tons of memory, when we starts zooming and playing around with the Map View in our application(for around 7-10 mins), When we come out of the controller which has MKMapView, its some how not releasing the total memory(I am using ARC in my App). I am allocating and initializing the MKMapView thru NIB. Controller 1 -->Controller 2 (has MKMapView) 1.5MB -->40-60MB (I have used the Instruments to find out leaks, but of no use) When i come back to Controller1

How to decode route points from the JSON Output Data?

妖精的绣舞 提交于 2019-12-24 01:56:09
问题 I am new in the ios field, Now i am trying to implement MKMapView Based iPhone Application. From the Google Map Web web service i Fetch the Data in JSON Output Format. - (void)update { self.responseData=[NSMutableData data]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://maps.googleapis.com/maps/api/directions/json?origin=Ernakulam&destination=Kanyakumari&mode=driving&sensor=false"]]; [[NSURLConnection alloc] initWithRequest:request delegate:self]; } -(void