>What is it called?
>How can I achieve it?
2.) How to display the following arrows on the pop-up screen?
A lot of simple tutorials on getting started with the iPhone’s map view. This is a pretty good one. If you don’t like it, then I suggest you use Google’s’MkMapView Tutorial’, you should find a lot of useful information.
In order to get the user’s location (latitude and longitude), you need to do a few things:
1) Make sure you The CoreLocation framework (CoreLocation.framework) has been imported
2) You need to add the following to the .h file:
#import
@interface exampleViewController: UIViewController
{
CLLocationManager *locationManager;
}
@property(nonatomic, retain)CLLocationManager *locationManager;
3) You need to add the following to the .m file (applicable to any place in your application)
This part will create a CLLocationManager Example:
self.locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLoca tion];
Then, you can get the current latitude and longitude using the delegate method:
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"New latitude: %f", newLocation.coordinate.latitude);< br /> NSLog(@"New longitude: %f", newLocation.coordinate.longitude);
}
You should also look at this existing question and this one, I think it should work Help you solve the second part of the problem.
Hope this helps.
1.) I need a blue circle on the map /Location point, as shown below.
>What is it called?
>How can I achieve it?
2.) How to display the following arrows on the pop-up screen?
I think what you are after is MKMapView; if so, you only need to add it in the interface builder and in the “Properties” inspector panel There is an option (checkbox) that allows you to “show user location”. By checking the box, it will make blue dots appear on the map (if you are using an iPhone simulator, it will only appear as Cupertio).
A lot of simple tutorials on getting started with iPhone’s map view. This is a pretty good one. If you don’t like it, then I suggest you use Google’s’MkMapView Tutorial’, you should find a lot of useful Information.
In order to get the user’s location (latitude and longitude), you need to do a few things:
1) Make sure you have imported the CoreLocation framework (CoreLocation.framework)
2) You need to add the following to the .h file:
#import
@ interface exampleViewController: UIViewController
{
CLLocationManager *locationManager;
}
@property(nonatomic, retain)CLLocationManager *locationManager;
3) You need to add the following content to the .m file (applicable anywhere in your application)
This part will create an instance of CLLocationManager:
self.locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
< p>Then, you can get the current latitude and longitude using the delegate method:
- ( void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"New latitude: %f" , newLocation.coordinate.latitude);
NSLog(@"New longitude: %f", newLocation.coordinate.longitude);
}
You should also take a look at this existing question And this one, I think it should help you solve the second part of the problem.
Hope this helps.