ピンが付いたmapViewがあり、地図上の別のポイントと私との間のCLLocationとgetDistanceの次のコードがあります。
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation{
Koordinate *kunde = [[Koordinate alloc] init];
kundenPoints = [[NSMutableArray array] retain];
for(int i = 0; i<[eventPoints count]; i++){
kunde = [eventPoints objectAtIndex:i];
CLLocation *userLoc = [[CLLocation alloc] initWithLatitude:kunde.latitude longitude:kunde.longtitude];
double distance = [newLocation getDistanceFrom:userLoc] / 1000;
if(distance <= 100){
[kundenPoints addObject:kunde];
}else {
}
}
[mapView addAnnotations:kundenPoints];
}
しかし、ボタンをタップしたときにマップを更新するメソッドを実装するにはどうすればよいですか? いつでも好きなときにピンを手に入れることができます。ボタンは問題ではなく、リフレッシュのみです!
誰かが私を助けてくれることを願っています??
よろしくマルコ