I am working on Google Map Module , using 1.9.0 Bundle, to find my location on regular basis , say 10 seconds and create a button to get my location button as one of mapview
Did your - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{
get called?
If not, you need to make sure your MapViewController
implements the CLLocationDelegate
. (Ex: @interface ViewController : UIViewController<CLLocationManagerDelegate>
in your MapViewController.h
file)
You can try this working example from GitHub, or the code snippet from this Gist.
Also, you should test it in your real device, otherwise you have to simulate a location in your XCode simulator (see image below, but it might not always work).
You have to add NSLocationWhenInUseUsageDescription
or NSLocationAlwaysUsageDescription
to your info.plist
file (note: don't rename or change the extension of the info.plist
file, the extension has to be .plist
):