在ios中集成谷歌地图

时间:2013-12-02 15:02:29

标签: ios iphone google-maps

在视图中我添加了一个视图mapView_googlemaps。我已将此视图分配给xib文件中的GMSMapView&也是出口。

在viewDidLoad中我添加了以下代码

GMSCameraPosition *camera=[GMSCameraPosition cameraWithLatitude:18.554863 longitude:73.804679 zoom:12];

    if(IS_IPHONE_5)
    {
        mapView_googlemaps = [GMSMapView mapWithFrame:CGRectMake(0, 0, 320, 455) camera:camera];

    }
    else
    {
        mapView_googlemaps = [GMSMapView mapWithFrame:CGRectMake(0, 0, 320, 367) camera:camera];
    }
    mapView_googlemaps.myLocationEnabled = YES;
    mapView_googlemaps.trafficEnabled=YES;
    mapView_googlemaps.mapType = kGMSTypeNormal;
    mapView_googlemaps.buildingsEnabled=YES;
    mapView_googlemaps.settings.compassButton = YES;
    mapView_googlemaps.settings.myLocationButton=YES;
    mapView_googlemaps.delegate= self;
    mapView_googlemaps.accessibilityElementsHidden=NO;

 [self.view addSubview:mapView_googlemaps];

但只有当我在iphone& amp;第一次使用。每次第一次给出不同的错误。以下错误发生在不同的时间,但仅限于第一次。

[__NSCFArray serverControlledParamsNotification:]: unrecognized selector sent to instance 0x15ff56a0

[__NSPathstore serverControlledParamsNotification:]: unrecognized selector sent to instance 0x15fuy6h9

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GMSx_PBMutableArray serverControlledParamsNotification:]: unrecognized selector sent to instance 0x157ce1a0'

-[OS_tcp_connection_destination serverControlledParamsNotification:]: unrecognized selector sent to instance 0x15f17aa0

-[__NSCFType serverControlledParamsNotification:]: unrecognized selector sent to instance 0x17feef30'

我认为这个错误是因为初始化错误。我没有得到确切的错误。

0 个答案:

没有答案