以下のように、経度と緯度を使用してマップビュー固有の場所を実装しています。
self.hotelmapView.showsUserLocation = YES;
self.hotelmapView.showsBuildings = YES;
locationManager = [CLLocationManager new];
if ([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[locationManager requestWhenInUseAuthorization];
}
//[locationManager startUpdatingLocation]; --> no need to add this for real devices.else should add this.
MKPointAnnotation *annotationPint = [MKPointAnnotation new];
annotationPint.title = @"anuradh hotel name";
annotationPint.coordinate = CLLocationCoordinate2DMake(51.585300, -0.1257480);
notationarray = [NSMutableArray new];
[notationarray addObject:annotationPint];
注 : これはシミュレーターで正常に動作します。デバイスでテストするときは、マップを表示するためにズームアウトする必要があります (正方形のテーブルでピンが表示され、マップは表示されません)。