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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:01:38+00:00 2026-05-27T23:01:38+00:00

I m trying to give 5 annotations around user location MKMapView…I m choosing random

  • 0

I m trying to give 5 annotations around user location MKMapView…I m choosing random values to annotations in my didupdateuserlocation method…when i run my projet all 5 annotations showing in a centre of the earth at a same place..its showing in sea area near to africa…anyone help me change different locations for annotations.

- (void)mapView:(MKMapView *)mv didUpdateUserLocation:(MKUserLocation *)userLocation
{
    CLLocationCoordinate2D userCoordinate = userLocation.location.coordinate;
    for(int i = 1; i<=5;i++)

    {
        CGFloat latDelta = rand()*.035;       ///RAND_MAX -5.0;
        NSLog(@"%f",latDelta);
        CGFloat longDelta = rand()*.03;       ///RAND_MAX -5.0;
        NSLog(@"%f",longDelta);
        CLLocationCoordinate2D newCoord = { userCoordinate.latitude + latDelta, userCoordinate.longitude + longDelta };
        MapPoint *mp = [[MapPoint alloc] initWithCoordinate:newCoord title:[NSString stringWithFormat:@"Azam Home %d",i] subTitle:@"Home Sweet Home"];    
        [mv addAnnotation:mp];
    }

}

i printed my random values..they are

2012-01-02 20:27:32.229 ShareImg[749:15803] 588.244995
2012-01-02 20:27:32.230 ShareImg[749:15803] 8474257.000000
2012-01-02 20:27:32.231 ShareImg[749:15803] 56792752.000000
2012-01-02 20:27:32.231 ShareImg[749:15803] 29548310.000000
2012-01-02 20:27:32.231 ShareImg[749:15803] 40043812.000000
2012-01-02 20:27:32.231 ShareImg[749:15803] 14106338.000000
2012-01-02 20:27:32.231 ShareImg[749:15803] 3535964.000000
2012-01-02 20:27:32.232 ShareImg[749:15803] 43735528.000000
2012-01-02 20:27:32.232 ShareImg[749:15803] 51057228.000000
2012-01-02 20:27:32.232 ShareImg[749:15803] 60217132.000000

help me with this…

  • 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-27T23:01:39+00:00Added an answer on May 27, 2026 at 11:01 pm

    CLLocationCoordinate2D is a structure of two CLLocationDegrees. CLLocationDegrees is a double, which presents position in degrees
    From documentation:

    latitude
    The latitude in degrees. Positive values indicate latitudes north of the equator. Negative values indicate latitudes south of the equator.
    longitude
    The longitude in degrees. Measurements are relative to the zero meridian, with positive values extending east of the meridian and negative values extending west of the meridian.
    

    So latitude must be between -90 and 90, and longitude must be between -180 and 180. Your random position is to large, and mapkit shows you position 0, 0 which is in Gulf of Guinea.

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

Sidebar

Related Questions

What I'm trying to do is give my user 4 options (simple links). If
I’m trying to give the user selection group of 8 checkboxes (CheckBox1, CheckBox2, …etc),
I'm trying to give the user ability to create customized list for my application,by
I am trying to give all the permissions to a user in the User
Basically I am trying to give a user a certain password so I can
I am trying to give user an alert dialog when alarm notification of calendar
I'm trying to give the user a chance to cancel FormClosing of MDI Parent
I'm trying to give even spacing all around images I have in a table,
I am trying to give the effect of general headings in this table and
I'm trying to give my plugin callback functionality, and I'd like for it to

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.