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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:55:43+00:00 2026-06-09T15:55:43+00:00

I have the users location on my app, but how would I drop an

  • 0

I have the users location on my app, but how would I drop an annotation on the current user location? Would I have to get the long & lat of the users location and drop an annotation that way? or how would I do it?

  • 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-06-09T15:55:44+00:00Added an answer on June 9, 2026 at 3:55 pm
    1. First import the necessary frameworks (CoreLocation and MapKit).
    2. Then create the Objective-C NSObject class Annotation
    3. Setup its .h:

      #import <Foundation/Foundation.h>
      
      #import <CoreLocation/CoreLocation.h>
      
      #import <MapKit/MapKit.h>
      
      @interface Annotation : NSObject <MKAnnotation> 
      
      @property (nonatomic) CLLocationCoordinate2D coordinate;
      @property (nonatomic, copy) NSString *title;
      @property (nonatomic, copy) NSString *subtitle;
      
      @end
      
    4. Setup its .m:

      #import "Annotation.h"
      
      @implementation Annotation
      @synthesize coordinate, title, subtitle;
      
      @end
      
      1. Setup viewDidLoad

           if ([CLLocationManager locationServicesEnabled]) {
        
           locationManager = [[CLLocationManager alloc] init];
        
           [locationManager setDelegate:self];
        
           [locationManager setDesiredAccuracy: kCLLocationAccuracyBestForNavigation];
        
           [locationManager startUpdatingLocation];
        
           }
        
          self.mapView.delegate = self; 
        
      2. Setup the didUpdateToLocation

           // IMPORT ANNOTATION
        
           - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
        
        
           [locationManager stopUpdatingLocation];
        
           double miles = 3.10686;
           double scalingFactor = ABS((cos(2 * M_PI * newLocation.coordinate.latitude / 360.0)));
        
           MKCoordinateSpan span;
        
           span.latitudeDelta = miles/69.0;
           span.longitudeDelta = miles/(scalingFactor * 69.0);
        
           MKCoordinateRegion region;
           region.span = span;
           region.center = newLocation.coordinate;
        
           [self.mapView setRegion:region animated:YES];
        
           Annotation *annot = [[Annotation alloc] init];
           annot.coordinate = newLocation.coordinate;
        
           [self.mapView addAnnotation:annot];
        
             }
        
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an app that monitors the user's location. I have a CLLocationManager object
I have a simple app that will allow a user to tag a location.
I am trying to get the zip code of the users current location.I have
I have a MKMapView & I use it to display user's current location. It
I have written an iPhone app that uses the iPhone's relative GPS location. I
I have a problem with obtaining the current user location. Code at first works
Is it possible to have the radiating circles like the user location annotation. So
i have created an application which show data from user current location. I want
I have a webpage that when landed on, will detect a user's physical location
i have an iOS application witch uses the current location of the user. I

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.