23
複数の注釈を一度に表示するためのMKMapViewの配置
MKMapViewに追加したい注釈がいくつかあります(0からnの項目があり、nは通常約5です)。注釈を細かく追加できますが、画面上のすべての注釈に一度に収まるようにマップのサイズを変更したいのですが、その方法がわかりません。 私は見てきました-regionThatFits:が、どうすればいいのかよくわかりません。私はこれまでに得たものを示すためにいくつかのコードを投稿します。これは一般的には簡単な作業だと思いますが、今のところMapKitに少し圧倒されています。 - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{ location = newLocation.coordinate; //One location is obtained.. just zoom to that location MKCoordinateRegion region; region.center = location; //Set Zoom level using Span MKCoordinateSpan span; span.latitudeDelta = 0.015; span.longitudeDelta = 0.015; region.span = span; // Set the region here... but I want …