Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:43:38+00:00 2026-06-13T11:43:38+00:00

I have been using the following code to zoom the mapview, so that all

  • 0

I have been using the following code to zoom the mapview, so that all the annotations will be displayed in the view at the same time at optimum zoom level. But in IOS 6, there seems to be some problem with the zoom level. Testing a few cases, I found that
1. If the contacts are in US, when the map is loaded it is zooming else where.
2. The zoom level seems to be correct in the UK area(as far as I have tested).
3. When I include contacts from both UK and US, the UK contacts gets rightly zoomed, but the US contacts are out of the view. But a slight swipe will ensure that all contacts fit into the view and are zoomed properly.

-(void)zoomToFitMapAnnotations:(MKMapView*)mapViews insideArray:(NSArray*)anAnnotationArray
{ 
if([mapViews.annotations count] == 0) return;

CLLocationCoordinate2D topLeftCoord;
topLeftCoord.latitude = -90;
topLeftCoord.longitude = 180;

CLLocationCoordinate2D bottomRightCoord;
bottomRightCoord.latitude = 90;
bottomRightCoord.longitude = -180;

for(MKPointAnnotation* annotation in anAnnotationArray)
{
    topLeftCoord.longitude = fmin(topLeftCoord.longitude, annotation.coordinate.longitude);
    topLeftCoord.latitude = fmax(topLeftCoord.latitude, annotation.coordinate.latitude);

    bottomRightCoord.longitude = fmax(bottomRightCoord.longitude, annotation.coordinate.longitude);
    bottomRightCoord.latitude = fmin(bottomRightCoord.latitude, annotation.coordinate.latitude);
}

MKCoordinateRegion region;
region.center.latitude = topLeftCoord.latitude - (topLeftCoord.latitude - bottomRightCoord.latitude) * 0.5;
region.center.longitude = topLeftCoord.longitude + (bottomRightCoord.longitude - topLeftCoord.longitude) * 0.5;
region.span.latitudeDelta = fabs(topLeftCoord.latitude - bottomRightCoord.latitude) * 1.1; // Add a little extra space on the sides
region.span.longitudeDelta = fabs(bottomRightCoord.longitude - topLeftCoord.longitude) * 1.1; // Add a little extra space on the sides

region = [mapViews regionThatFits:region];
[mapView setRegion:region animated:YES];
}

After loading the mapview with annotations, in random cases I get the following log

<GEOTileSource: 0x108f6470>: Error downloading tiles Server Error: Error Domain=GEOErrorDomain Code=-204 "The operation couldn’t be completed. (GEOErrorDomain error -204.)" UserInfo=0x18a5b9c0 {UnderlyingErrors=(
"Error Domain=GEOErrorDomain Code=-204 \"The operation couldn\U2019t be completed. (GEOErrorDomain error -204.)\""
)}

What could be the reason for this and how can I correct it? Couldn’t find anything helpful after googling.

I am not able to identify any particular pattern for this zooming inconsistency. The above code is working fine in previous IOS versions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:43:39+00:00Added an answer on June 13, 2026 at 11:43 am

    I almost offered a bounty on your question but then I noticed, that with the new maps in iOS6 you just cannot zoom out to see the whole world (try it yourself in the maps app). There is a maximum zoom level which you can figure out by commenting out your for loop and logging this:

    NSLog(@"region.span.latitudeDelta = %f", region.span.latitudeDelta);
    NSLog(@"longitudeDelta = %f", region.span.longitudeDelta);
    
    [map setRegion:region animated:NO];
    
    NSLog(@"region.span.latitudeDelta = %f", map.region.span.latitudeDelta);
    NSLog(@"longitudeDelta = %f", map.region.span.longitudeDelta);
    

    The output looks like this:

    region.span.latitudeDelta = 179.283409
    longitudeDelta = 360.000000
    region.span.latitudeDelta = 76.269114
    longitudeDelta = 98.437499
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using the following code for loading JQuery in all of my
I have the following code that I have been using to Set properties in
I'm currently using the following code to scan files that have been uploaded as
I am using the following code for the Share Price Application I have been
I have been using the following code to check whether a dialog is already
I have the following code which I have been using on a 188 byte
I have been using the following code to query one table: public Cursor fetchFilteredItemsNearSortedByDistance(String
I have been using the following code: if ( ($.browser.msie && parseFloat($.browser.version) < 7)
I am using the following code to create calendar controls on textboxes that have
I have been using the following code to check if a form already exists:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.