iphone - Forward geocoding and zoom to fit multiple locations -


The following is the code that I used to load Nkshavlokn I

  - (zero) getLatLongCoordinates: (NSString *) addressStr firstNameTitle: (NSString *) firstNamesTitle lastNameTitle: (NSString *) lastNamesTitle {Mkepoint annotations * Anoteshnpoint = [[Mkepoint annotations Elok] init]; [Geocodar GOCADEdressString: Addressor Stretching Handler: ^ (NSARA * Placemark, NSER * Error) {Sfi. Placemark = placemark; CLPlacemark * placeInfo = [placemarks objectAtIndex: 0]; MapCenter.latitude = placeInfo.location.coordinate.latitude; Mapcenter.longitude = placeInfo.location.coordinate.latitude; [Annotationpoint setcordinate: map center]; [Annotationpointrayedobject: annotationpoint]; AddAnnotation = [[[MyAddressAnnotation alloc] initWithCoordinate: mapCenter Title: firstNamesTitle sub-title: last Namtitl] Atorelejh]; AddNnotation.firstNameTitle = FirstnameTitle; AddNnotation.lastNameTitle = Last name change; [See map add symbol: connective]; }];   

}

I Method [self Jhumtofitmapanoteshn: mapView withArray: annotationPointsArray] need to call; To fit all the contacts in the map view at the maximum zoom level, I have been using the following code successfully until the previous implementation. But since I am using blocks now, I am a little confused about calling this method. Before I call this method and it needs to get all the location coordinates to cross the array.

  - (minus) Jhumtofitmapanoteshns: (Mkemapdrishy *) Nkshaviseshon the Sathare: (Ansaarara *) Aananoteshnarere {if ([Nkshavidrishy. Counting numbers] == 0) return; CLLocationCoordinate2D topLeftCoord; TopLeftCoord.latitude = -90; TopLeftCoord.longitude = 180; CLLocationCoordinate2D Right Coder Down; Right code below. Lightness = 90; Right wright below Lame = -180; For (Mkepoint Anonoteshn * annotation AN Anoteshnare) {topLeftCoord.longitude = fmin (Shirshvilnb console. Lame, Anoteshnkkordinet. Langliti); TopLeftCoord.latitude = fmax (topLeftCoord.latitude, annotation.cordinate.latididate); Right wright below Lamba = Fmx (Right code below. Long, annotation. Cordinet. Lenality); Right code below. LATITUDE = Fine (Right code below: LatedDude, Annotation.CordinateLatidit); } MKCoordinateRegion area; Region.center.latitude = topLeftCoord.latitude - (topline cord.latititude - Right code below. LATITUDE) * 0.5; Area. center. Lame = Top Left Coord. Lambita + (Right code below. Lame - Top-left corner. Lame) * 0.5; Area.span.latitudeDelta = fabs (topLeftCoord.latitude - bottomRightCoord.latitude) * 1.1; Area.span.longitudeDelta = fabs (Right code below. Lame - Top Late Quad., Lame) * 1.1; Area = [area sees area area: area]; [MapView Set Region: Animated Area: No]; }   

To call the above method, where is the right place in the upper part of the code or I need to find some other way to do this.

Edit: I was avoiding using mapCenter and got the coordinate directly from placeInfo to getLatLongCoordinates method And I'm recovering it and the problem is solved. But I still understand, why the first method does not work.

I use this method of my own case

Generally I Calling method when I add annotation to my map view. So the best way to add this is to add the annotation view map.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -