ios7 - How to properly set the Radius of CLRegion? -
this code creating geofence:
geofence *geofence = [[geofence alloc] init]; [geofence setradius:100.0]; [geofence setidentifier: @"fence1"]; [geofence setlocation:currentlocation]; clregion *region1 = [[clcircularregion alloc] initwithcenter:[geofence.location coordinate] radius:geofence.radius identifier:geofence.identifier]; region1.notifyonentry=yes; region1.notifyonexit=yes; [self.locationmanager startmonitoringforregion:region1];
i that, above code works, meaning geofence have been created. there's problem i've been encountering.
i have .gpx files (in using simulation of current location), distances center of region/geofence follows: 55m, 90m, 150m, 200m, 300m, 500m, 1km, 5km , 10km.
my problem is, seems geofence radius not 100m, because when simulate using gpx files distance center of geofence 55m, 90m, 150, 200m, 300m, 500m, 1km. delegate methods of locationmanager -didenterregion
, -didexitregion
making respond i'm within geofence radius "100m".
only gpx files distances geofence center 5km , 10km responds said delegate methods i'm outside geofence.
can me resolve scenario guys?
i think problem may using same variables initialize region ones using initialize geofence far center coordinates concerned. 1 thinks within other.
Comments
Post a Comment