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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:49:51+00:00 2026-05-21T10:49:51+00:00

i`m using MapKit framework and i want to ask you about something : +

  • 0

i`m using MapKit framework and i want to ask you about something :

+ (NSUInteger)zoomLevelForMapRect:(MKMapRect)mRect withMapViewSizeInPixels:(CGSize)viewSizeInPixels
{
    NSUInteger zoomLevel = MAXIMUM_ZOOM; // MAXIMUM_ZOOM is 20 with MapKit
    MKZoomScale zoomScale = mRect.size.width / viewSizeInPixels.width; //MKZoomScale is just a CGFloat typedef
    double zoomExponent = log2(zoomScale);
    zoomLevel = (NSUInteger)(MAXIMUM_ZOOM - ceil(zoomExponent));
    return zoomLevel;
}

this method..how can i know the value of mRect and viewSizeInPixels parameters to be able to call it?? thx in advance 🙂

  • 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-21T10:49:52+00:00Added an answer on May 21, 2026 at 10:49 am

    The map view’s current MKMapRect is the visibleMapRect property and the view size would be in frame.size (since MKMapView is a subclass of UIView) so the method would be called using something like:

    NSUInteger zoomLevel = [UtilityClass 
                               zoomLevelForMapRect:mapView.visibleMapRect 
                               withMapViewSizeInPixels:mapView.frame.size];
    

    UtilityClass is whatever class that method is in and replace mapView with whatever you map view is actually named.

    By the way, the MapKit Framework Reference and the Location Awareness Programming Guide are worth looking at.

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

Sidebar

Related Questions

Having follow the tutorial at http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial/ to integrate the MapKit into my application. However,
I'm familiar with using Google Maps Javascript API. Recently I started using MapKit framework
I'm using the MapKit framework and I have used pins to display the exact
I am using MapKit. I want to know how to get current user's location.
I am using Mapkit in my application, i want to submit the application to
I am using the Mapkit FrameWork for an iPhone. I have city list and
First off - I'm not using MapKit. I'm using my own controls for something
Im using MapKit in my application and disaply the user location with [mapview setShowUserLocation:YES];
I'm using MapKit to display the user's location relative to pins around them. I'd
When using the MapKit library and placing a pin/MKAnnotation, you will implement the MKAnnotation

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.