MapView と、現在の場所を表示するための必要な条件を追加し、ボタン機能を使用して、アップルのドキュメントからこのメソッドだけを追加しました。
- (IBAction)refreshMapMethod:(id)sender
{
double latitude = 39.281516;
double longitude =-76.580806;
MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:CLLocationCoordinate2DMake(latitude, longitude) addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:placemark];
[mapItem setName:@"Name of your location"];
[mapItem openInMapsWithLaunchOptions:nil];
/////
////////
CLLocation* fromLocation = mapItem.placemark.location;
// Create a region centered on the starting point with a 10km span
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(fromLocation.coordinate, 10000, 10000);
// Open the item in Maps, specifying the map region to display.
[MKMapItem openMapsWithItems:[NSArray arrayWithObject:mapItem]
launchOptions:[NSDictionary dictionaryWithObjectsAndKeys:
[NSValue valueWithMKCoordinate:region.center], MKLaunchOptionsMapCenterKey,
[NSValue valueWithMKCoordinateSpan:region.span], MKLaunchOptionsMapSpanKey, nil]];
}
ボタンを押した後、長押しによるマップビューへの注釈の追加、パスのトレースなど、すべての機能を備えた新しいビューを取得しています。これが小さな機能でどのように起こっているか
どんなアイデアでも助けてください。