我正在实现一个带有经度和纬度的地图视图特定位置。如下所示。
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];
注意:这在模拟器中运行良好。当我使用设备进行测试时,我必须缩小才能查看地图(图钉显示方表,不显示地图)