简体   繁体   中英

iOS 6 and Mapkit : User location

I was suprise when i saw that my app can't know where I am located with a MapKit on iOS6 !

I just want to zoom to user's location when the map is starting ! How can I do it ?

Please help me

Thank you so much !! (PS: I saw that the CLCoordinate for sending a request for routing is working fine)

Do you mean that showsUserLocation doesn't have any effect? Or does your location monitoring isn't updating you position? I tested both in iOS 6, works for me. Maybe you could post some code.

EDIT:

Seems like location monitoring is not activated in your app. First of all you have to do sth like this to enable the cllocation manager:

if (nil == locationManager)
    locationManager = [[CLLocationManager alloc] init];

//set the delegate for the location manager
locationManager.delegate = self;
// set your desired accuracy
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;

[locationManager startUpdatingLocation];

At that point the blue location indicator should be visible. As long as you've set showsUserLocation = YES on your map.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM