any method to show user location in ios

Is there any method that take latitude and longitude as parameter and google map link or apple map link these three parameter to show user location on google map or apple map so user can use google created google map functionality like arrow direction or zoom in/out.

I don't want to use MKMapView of iOS to show user location in my app.

thanks in advance give me any cool method(latitude,longitude,google map link)as parameter.

Answers


For coordinates only, you need CoreLocation, so google that.

But if you need to show a map and arrow, you do need a maps framework. Either go for built in MKMapKit, or you can download Google Maps SDK.


First of all , Please import this framework

#import , to import this framework , you need to select your project then go to build phases , click on link binaries with libraries and add the core location framework .

Add this code in your view controller in view didload method:-

CLLocationManager *locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest; // 100 m
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
    [locationManager requestAlwaysAuthorization];
}
[locationManager startUpdatingLocation];

// Delegates of Mapview

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(newLocation.coordinate, 800, 800);
[map_View setRegion:[map_View regionThatFits:region] animated:YES];
if (newLocation != nil) {
    NSLog(@"%f %f",currentLocation.coordinate.longitude,currentLocation.coordinate.latitude);
    [locationManager stopUpdatingLocation];
    locationManager = nil;
}

// Reverse Geocoding
CLGeocoder *geocoder = [CLGeocoder new];

    dispatch_async(dispatch_get_main_queue(), ^{
        [geocoder reverseGeocodeLocation:currentLocation completionHandler:^(NSArray *placemarks, NSError *error) {
            if (error == nil && [placemarks count] > 0) {
                placemark = [placemarks lastObject];
            } else {
                NSLog(@"%@", error.debugDescription);
            }
        } ];

    });

}

Don't forget to add this line in your plist file :-

NSLocationAlwaysUsageDescription NSLocationWhenInUseUsageDescription


Need Your Help

TFS 2012 and VS 2010

visual-studio-2010 tfs2010 visual-studio-2012 tfs2012

I was very excited to hear TFS 2012 made a step towards distributed source control in allowing source code to be modified (without major issues) when TFS is offline.

Get event list based on location

facebook api events location

I've been digging around on the Facebook developer site to see if there is a way to get local event information for display on my own web app.