views:

306

answers:

3

In my app I'm using map kit.The map kit is working fine but sometimes it fails to acquire user location,so i thought i could show en error message but when i applied the error message it prompting again and again looking very annoying.so i want to ask that when map kit starts to get current user location and if it fails how do i show an error message something like this "Maps unable to determine your current location please try after sometime" then hide the message and show it after sometime if it again fails to acquire user location or if it gets the user location then do nothing.

A: 

Why don't you use CLLocationManager to find user's location? It has one pretty delegate method that, I think, will be helpful in your case.

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
Morion
i don't want to use location manager because i must show default blue dot of mapkit.
Rahul Vyas
it's fine to use both. if the CLLocationManager fails, mapkit will as well.
Carl Coryell-Martin
@Carl Coryell-Martinhello,no i am getting location from cllocation manager but not getting the blue dot.
Rahul Vyas
you need to turn on the showsUserLocation property of your MKMapView to have the blue dot show up.
John Wang
A: 

I have used the map kit in my app and when i increase the span of the map it shows crash on iphone.

Anmol Bajpai
A: 

Was this question ever resolved?

I am having a similar problem, in the CLLocationManager::didUpdateToLocation is providing the correct user location, while my KVO against mapView.userLocation is not.

MapView loses the user's location somewhat arbitrarily and trying to be a solid repro is eluding me. Seems zoom related though; I remove annotations when I detect that there's a double touch for zoom. And I suspect I'm over-releasing somewhere and putting my instance on MapKit into a questionable state. Guard Malloc and NSZombie has not helped. Additionally, a single line of instrumentation code typically causes the repro to disappear.

Perhaps this is unrelated, but I'll share anyway, in case it might be. Occasionally on startup, the blue dot does not appear. A simple nudge of the map will make it appear. Might be unrelated.

I have two questions:

1) Might anyone have seem anything similar and solved the problem. The solution mightn't be the same for me, but it may help point me in the right direction

2) What's the best way to "encourage" mapkit to get the right user location? I could release the mapview and re-initialize and swap the view, but that feels a little heavy handed.

This problem seems to occur only with iPad 3.2 and iOS4. It didn't manifest on 3.1.3.

Bill