Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)locationManager:(CLLocationManager *)manager
- didUpdateLocations:(NSArray *)locations {
- // If it's a relatively recent event, turn off updates to save power
- NSLog(@"%@ locations",locations);
- float Lat = _locationManager.location.coordinate.latitude;
- float Long = _locationManager.location.coordinate.longitude;
- NSLog(@"Lat : %f Long : %f",Lat,Long);
- CLLocationCoordinate2D center = CLLocationCoordinate2DMake(28.52171,77.2015457);
- NSLog(@"center check %@",center);
- CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:center
- radius:500
- identifier:@"new region"];
- BOOL doesItContainMyPoint = [region containsCoordinate:CLLocationCoordinate2DMake(Lat,Long)];
- NSLog(@"success %hhd", doesItContainMyPoint);
- }
- the issue is ,here i m providing a static region for which i m checking (center)
- but the requirement is, this region will take the lat n long of the riders and riders can vary in number
- i hv all lat n long in an array of dictionary. First the driver at pick the first rider in the list and at that time i need the region of rider 1 location.
- I m not getting any idea how to achieve this
- if i do like this
- for (NsMutableDictionary * dict in goersList)
- {
- rider_id=[dict valueForKey:@"trip_id"];
- lat=[dict valueForKey:@"origin_lat"];
- longi=[dict valueForKey:@"origin_long"];
- }
- then how will it knw that the first region is to be monitered and after existing from that range i hv to checkfor second location
Add Comment
Please, Sign In to add comment