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

The Archive Base Latest Questions

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

I hava a Google Maps implementation in my iPhone app. First, the map is

  • 0

I hava a Google Maps implementation in my iPhone app. First, the map is set to a default location:

- (void)viewDidLoad {
    firstTimeUserLocationCentered = YES;
    [self moveToDefaultLocation];
    firstTimeUserLocationCentered = NO;
    ...
}

- (void)moveToDefaultLocation {
    MKCoordinateRegion myDefaultRegion;
    myDefaultRegion.center.latitude = defaultLocLat;
    myDefaultRegion.center.longitude = defaultLocLong;
    myDefaultRegion.span.latitudeDelta = defaultLocLatDelta;
    myDefaultRegion.span.longitudeDelta = defaultLocLongDelta;
    [self.myMapView setRegion:myDefaultRegion animated:YES];
}

If the user allows that his location can be used by the app, this method is called:

- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {
    if (!firstTimeUserLocationCentered) {
        MKCoordinateRegion myUserRegion;
        myUserRegion.span.latitudeDelta = userLocLatDelta;
        myUserRegion.span.longitudeDelta = userLocLongDelta;
        myUserRegion.center = userLocation.coordinate;
        [self.myMapView setRegion:myUserRegion animated:YES];
        firstTimeUserLocationCentered = YES;
    }
}

But now I have the problem, that I want to integrate a button so by pressing it, the location should be centered in the map. So if the user has allowed the application to use the location, the map should be centered where the user is otherwise the default location should be used, so I can call [self moveToDefaultLocation].
How can I do this?

Also I am searching for an icon for this “user location centering” button. In this image, there is a button icon which I am looking for: http://gadgetress.freedomblogging.com/files/2008/01/iphonemapslg.jpg The icon on the left hand side of “Search”, where can I get it?

Best Regards Tim.

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

    I solved it with:

    MKUserLocation *myUserLocation = self.myMapView.userLocation;
    if (!myUserLocation.location) {
        [self moveToDefaultLocation];
    } else {
       self.mapView.centerCoordinate = self.mapView.myUserLocation.location.coordinate;
    }
    

    But I did not found this icon… Does anyone know where I can get this icon?

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

Sidebar

Related Questions

I am writing a project on Google App Engine, within it I have a
I hava a UINavigationController. The first level is a UITableViewController, the second level just
I hava a .app application and I want to include it inside my project
I hava a simple set of two related tables of an 'order' that has
i hava a set of following tables customer(cus_id,cus_name); jointAccount(cus_id,acc_number,relationship); account(acc_number,cus_id) now i want to
I hava a WP 7.5 app. I have a splash screen and then comes
I hava a UIButton. And for my button I want to set image with
I hava a php variable that contain JSON type data. $list = [{id:10,first_name:first,mi_name:,last_name:last,nick_name:HH}]; and
I hava a application that works with pictures(just a full screen app with 3
I hava set up AJAX script that when you click the button it calls

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.