0

我正在实现一个带有经度和纬度的地图视图特定位置。如下所示。

 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];

注意:这在模拟器中运行良好。当我使用设备进行测试时,我必须缩小才能查看地图(图钉显示方表,不显示地图)

4

1 回答 1

0

它会在 IOS8.3 和更高版本的 sim 和 device 上发生(可能是它的一个错误)。系统地图应用程序运行(它也显示空网格)一分钟,直到它下载地图。在 MKMapView 开始正常渲染之后。

于 2016-07-11T07:37:32.800 回答