I wanted to implement geofencing within some regions. Since I am not currently using an iPhone to test out my application, I wanted to test out the Core Location framework on the simulator. I created a few simple regions with a 100m radiuses. I have two different regions that have a center at the following coordinates: 39.541957 latitude, -121.749642 longitude
and another with the coordinates 39.537224 latitude, -121.754556 longitude
. However, when I use the iPhone simulator and try to enter one of the regions, I happen to enter both regions instead of just one region, even though I set the radiuses to 100m like so:
CLCircularRegion(circularRegionWithCenter: CLLocationCoordinate2D(latitude: queryLat, longitude: queryLong), radius: 100.0, identifier: tuple[location])
Entering regions:
func locationManager(manager: CLLocationManager!, didEnterRegion region: CLRegion!) {
NSLog("Entering region... " + region.identifier)
}
Does anyone have any ideas why I would enter in both regions instead of just one? Is there any way to improve this radius accuracy? I have tried looking at all sorts of links like http://www.kevfoo.com/2012/07/Core-Location-The-Missing-Details/ and iOS Geofence CLCircularRegion monitoring. locationManager:didExitRegion does not seem to work as expected but I can't seem to find a solution to only entering in one region. All help would be appreciated! Thanks!