我需要一些过滤器的帮助。我如何实现一个算法,过滤掉用户位置半径内的相关地图注释,非常感谢!任何反馈表示赞赏!谢谢你,祝你有个愉快的一天。
到目前为止我的代码:
CLLocationCoordinate2D coordinates;
CLLocationDistance test = 1000; // set distance
coordinates.latitude = [[row objectForKey:@"latitude"] doubleValue];// get user's latitude
coordinates.longitude = [[row objectForKey:@"longitude"] doubleValue];
MapAnnotation *annotation = [[MapAnnotation alloc] initWithCoordinate:coordinates title:titles subtitle:contents image:[row objectForKey:@"image"]]; // specify annotation's detail
[self.mapView addAnnotation:annotation];// adding annotation into the map
[annotation release];