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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:12:31+00:00 2026-05-22T23:12:31+00:00

I have an app which is providing a zoomable MKMapView to the user. I

  • 0

I have an app which is providing a zoomable MKMapView to the user. I want to be able to store the user’s preferred coordinates and zoom level for when the map view is first displayed.

Currently, in viewDidLoad, I am providing a default set of coordinates and zoom level for the initial map presentation:

    zoomLocation.latitude = 55.50;
    zoomLocation.longitude = -5.50;

    // specify size of region to display
    MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 340.0*METERS_PER_MILE, 340.0*METERS_PER_MILE);

    // auto adjust region to fit screen
    MKCoordinateRegion adjustedRegion = [mapView regionThatFits:viewRegion];                

    // display the new region
    [mapView setRegion:adjustedRegion animated:YES];

What I am trying to do is, when the user scrolls and zooms the map to their preferred default view, they can hit the “Set Default” button and store the required properties to implemented in future whenever the view loads.

To store the coordinates of the user’s selected view, I have this:

// gets coordinates of currently viewed map image
CGPoint pointCentrePoint = CGPointMake(mapView.frame.size.width/2, mapView.frame.size.height/2);
centrePoint = [mapView convertPoint:pointCentrePoint toCoordinateFromView:mapView]; 

NSLog(@"LAT: %f LON: %f", centrePoint.latitude, centrePoint.longitude);

What I’m struggling with is how to store the user’s selected MKCoordinateRegion, or zoom level. Is there a way I can access this property for the current view, so it can be reused in future when the view loads?

  • 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-22T23:12:32+00:00Added an answer on May 22, 2026 at 11:12 pm

    Unlike the JavaScript Google Maps api, the MKMapView doesn’t have a readily available “zoom level” property (it isn’t really necessary for your purpose).

    Work with the center and span values in the region property.

    This question gives an example of how to save/load the region to NSUserDefaults.

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

Sidebar

Related Questions

I have a User model in my app, which I would like to store
I have app in which i have recorded sound files i want that i
I have an App which launches the google Map App. The code is: UIApplication
I have an app in which I want to turn the menu button off
I have an app which uses a keyboard hook procedure in a library. The
I have an app which is quite huge. It has tons of images and
I have an app which acts almost like a daemon. Sometimes it quits on
I have an app which contains a scrollview with several tableviews. Each tableview is
I have an app which generates some files in the app directories I need
I have an app which will generate 5 - 10 new database records in

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.