iphone - "StopUpdatingLocation" is called but GPS Arrow doesnt disappear -
i don´t understand why gray gps arrow don´t disappear after stopupdatinglocation called. here code:
- (void)viewdidload { [super viewdidload]; // additional setup after loading view nib. if (self.locationmanager == nil) { self.locationmanager = [[[cllocationmanager alloc] init]autorelease]; self.locationmanager.desiredaccuracy = kcllocationaccuracybest; self.locationmanager.delegate = self; } cllocation *location = [self.locationmanager location]; cllocationcoordinate2d coordinate = [location coordinate]; g_lat = coordinate.latitude; g_lng = coordinate.longitude; [self.locationmanager startupdatinglocation]; }
and here ist didupdatelocation:
- (void) locationmanager:(cllocationmanager *)manager didupdatetolocation: (cllocation *)newlocation fromlocation:(cllocation *)oldlocation { nslog(@"core location has position."); cllocationcoordinate2d coordinate = [newlocation coordinate]; global_lat = coordinate.latitude; global_lng = coordinate.longitude; [self.locationmanager stopupdatinglocation]; } - (void) locationmanager:(cllocationmanager *)manager didfailwitherror:(nserror *)error { nslog(@"core location can't fix."); }
i checked if other app using gps! after 20 minutes arrow still there.... help!
edit:
i think missed important, on first view after app started there google map! code:
gmscameraposition *camera = [gmscameraposition camerawithlatitude:g_lat longitude:g_lng zoom:15]; self.mapview = [gmsmapview mapwithframe:cgrectmake(1.0f, 160.0f, 320.0f, 100) camera:camera]; self.mapview.delegate = self; self.showsuserlocation = yes; self.mapview.trafficenabled = yes; self.mapview.mylocationenabled = yes; self.mapview.settings.mylocationbutton = yes; self.mapview.settings.compassbutton = yes; [self.mapview setuserinteractionenabled:yes]; [self.mapview setcamera:camera]; [self.containerview addsubview:self.mapview];
is possible google map updating time? if yes, how can stop that?
regarding google map: turn off mylocationenabled
field when push new view controller? if not, can keep gps running. can try not starting gps on next view controller. if gps stays on, map holding it.
side note: can part of normal operation. if app stops receiving location updates, doing fine. ios doing lots of optimizations , leaving gps on time part of this. during testing saw arrow stays on while if app killed xcode.
Comments
Post a Comment