harikant_jammi

proper way of using agsgps ????

Discussion created by harikant_jammi on Oct 27, 2010
Latest reply on Oct 28, 2010 by DGoyal-esristaff
I have a gps button in my app which is used to toggle on/off the gps services.
I am using the following code to toggle gps services.
The method below is called when the button is touched

-(void) startGPS {
self.mapView.gps.autoPan = YES ;
if ((self.mapView.gps.enabled)) {
 
  [self.mapView.gps stop];
  [self.gpsButton setImage:[UIImage imageNamed:@"gps_off.png"] forState:UIControlStateNormal] ;
 
}
else if(!(self.mapView.gps.enabled))
{
   [self.mapView.gps start];
   [self.gpsButton setImage:[UIImage imageNamed:@"gps_on.png"] forState:UIControlStateNormal]  ;
}


}

This code works fine when location services are turned ON.
Now in iOS 4 , if location services are turned off only for that particular app keeping the global location settings ON then also my buttons are toggling to GPS ON state.

Has anyone observed this problem ?? Is there a workaround for this. Ideally , I would like a sample code to use AGSGPS in a proper way.

Regards,
Harikant Jammi

Outcomes