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 4106468
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:22:51+00:00 2026-05-20T21:22:51+00:00

How can I set the zoom level of my Google MapKit in SDK? Like

  • 0

How can I set the zoom level of my Google MapKit in SDK? Like for example, I live in New York, and I’ve set up 4 coordinate positions in my ProjectName-info.plist (URL Types > Item 0 > URL Schemes > Item 0), then I’ve set up my code in my UIViewController subclass file:

#import "GoogleMap.h"
#import "MyAnnotation.h"

@implementation GoogleMap

        - (void)viewDidLoad {
        [super viewDidLoad];

        variable1 = [[NSArray alloc] initWithContentsOfFile:[[NSBundle mainBundle] 
                                                             pathForResource:@"NewYorkAreas" 
                                                             ofType:@"plist"]];

        double minLat = [[variable1 valueForKeyPath:@"@min.latitude"] doubleValue];
        double maxLat = [[variable1 valueForKeyPath:@"@max.latitude"] doubleValue];
        double minLon = [[variable1 valueForKeyPath:@"@min.longitude"] doubleValue];
        double maxLon = [[variable1 valueForKeyPath:@"@max.longitude"] doubleValue];

        MKCoordinateRegion region;
        region.center.latitude = (maxLat + minLat) / 2.0;
        region.center.longitude = (maxLon + minLon) / 2.0;
        region.span.latitudeDelta = (maxLat - minLat) * 1.05;
        region.span.longitudeDelta = (maxLon - minLon) * 1.05;
        map.region = region;

        for (NSDictionary *newYorkAreasDict in variable1){
            MyAnnotation *annotation = [[MyAnnotation alloc] initWithDictionary:newYorkAreasDict];
            [map addAnnotation:annotation];
            [annotation release];
        }
    }

    - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{

        if (map.userLocation == annotation){
            return nil;
        }

        NSString *identifier = @"MY_IDENTIFIER";

        MKAnnotationView *annotationView = [map dequeueReusableAnnotationViewWithIdentifier:identifier];
        if (annotationView == nil){
            annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation 
                                                           reuseIdentifier:identifier] 
                              autorelease];
            annotationView.image = [UIImage imageNamed:@"logo.png"];
            annotationView.canShowCallout = YES;

            annotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
        }
        return annotationView;
    }

So this is all I have for now in my code, which works perfectly when I run and debug the app, and shows me the location of all 4 areas that I set in a good zooming level, but now I want only 1 area to set, so when I erased the other 3 area and when running it and only giving me one area, the zooming level seems very close to the map:

enter image description here

So I when the code is fixed (assuming someone helped me fix the code for the zooming level), the next time I run it, when I click on “Find us on Google Map”, my Google Map opening page zoom level should look like this:
enter image description here

So yea hopefully someone can help me fix this zooming level when I begin opening Google Map, thanks!

(About the New York variable names, forget it, I don’t live in New York lol)

  • 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-05-20T21:22:52+00:00Added an answer on May 20, 2026 at 9:22 pm

    Set a minimum value for latitudeDelta and longitudeDelta. I would do it something like this:

    MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(CLLocationCoordinate2DMake((maxLat + minLat) / 2.0, (maxLon + minLon) / 2.0), 1000.0, 1000.0);
    region.span.latitudeDelta = MAX(region.span.latitudeDelta, (maxLat - minLat) * 1.05);
    region.span.longitudeDelta = MAX(region.span.longitudeDelta, (maxLon - minLon) * 1.05);
    

    The first line creates a region with a 1km by 1km rectangle, and the following lines enlarge the rectangle if the points are spread farther.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to set default zoom level in google map to 11 miles can
Is there a way I can set a minimum zooM level for my MapView?.
Is it possible to change the zoom level for myLocation with the new Google
How can I re-set ticks's formatString after a zoom operation? I'm using $.jqplot.DateAxisRenderer plugin
Im trying to figure out how to set the minimum someone can zoom out.
I'm using google map fitBounds, then I use map.setZoom to zoom-in one level (after
I'm using fitBounds() to set the zoom level on my map too include all
When I set the ViewportWidth of a Deepzoom image in Silverlight the zoom level
I can set the width and height of my canvas by setting the width
I can set the relationship between View Model and view through following DataContext syntax:

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.