ios - 谷歌地图 sdk 在 iPhone 中显示方向

标签 ios iphone google-maps

我正在使用 Googlemap sdk 在我的应用程序中显示方向,我已经下载了一个示例应用程序。我已经将所有功能集成到我的应用程序中。但是 map 没有显示。下面是我正在使用的代码。

  GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:9.96 longitude:76.31 zoom:12];
_mapView = [GMSMapView mapWithFrame:self.view.bounds camera:camera];


_mapView.myLocationEnabled = YES;
_mapView.delegate = self;
[self.view addSubview:_mapView];

_markerStart = [GMSMarker new];
_markerStart.title = @"Raj";
_markerStart.snippet=@"2Km";
_markerStart.icon = [GMSMarker markerImageWithColor:[UIColor greenColor]];

在上面的代码中,_mapView 变成了 nil,这是关于 api key 还是 google map sdk 的问题,我已经复制到我的项目中了。

最佳答案

在查看您的代码后,我可以说:可能对其他人有帮助

  1. 拖放您的 GoogleMaps.framework,使其位于根文件夹并显示在 Build Phases -> Link Binary with Libraries

enter image description here

  1. GoogleMaps.framework->Resources -> GoogleMaps.bundle 添加 GoogleMaps.bundle

  2. 添加所有框架,如:

enter image description here

关于ios - 谷歌地图 sdk 在 iPhone 中显示方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24931324/

相关文章:

iphone - 如何使按钮的文字向左对齐?

ios - 是否可以使用 Google plus API 获取电话号码

ios - 是否可以在后台运行 CLLocationManager

iphone - 在照片应用程序中创建、删除和添加图片到相册?

ios - Swift:为什么我的 -1 按钮不能正常工作?

iphone - 无法临时安装iphone应用程序

swift - 如何在没有 InfoView 的情况下在 GMSMarker 上添加点击事件

java - 创建的 url 有效,但当应用程序发送时会遇到错误

javascript - Google Maps HTML5 点击获取经纬度

iphone - 如何在不购买 iPhone 的情况下测试我的网站在 Mobile Safari 上的呈现情况?