ios - GMSMapView 显示空白 map

标签 ios swift google-maps

我将 GMSMapView 添加到我的屏幕中,但我只能看到我的位置图标和我添加的标记。为什么我看不到道路、建筑物等?

这是我的代码:

let camera = GMSCameraPosition.cameraWithLatitude(latitude,
longitude: longitude, zoom: 11.5)
let mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera)

mapView.myLocationEnabled = true
mapView.settings.myLocationButton = true

self.view = mapView

var marker = GMSMarker()
marker.position = CLLocationCoordinate2DMake(location.latitude, location.longitude)
marker.title = location.name
marker.snippet = location.address
marker.map = mapView

有什么建议吗?

最佳答案

出现空白图的主要原因之一是key没有设置好

您是否正确设置了 API key 。

[GMSServices provideAPIKey:yourAPIKey];

关于ios - GMSMapView 显示空白 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33732031/

相关文章:

ios - 如何按索引打印 JSON 字典元素?

iphone - UITableView 在编辑后取消选择选定的单元格

ios - Mvvmcross 与 Xamarin iOS,是否可以在 ViewController 中加载 ViewController?

swift - 使用 Swift 的 SSH 连接

ios - 选择时的 UICollectionView 动画单元格图像

javascript - Angular 5 和 Google Maps v3 Api - 从 map "click"事件获取坐标

ios - Google Play 和 Apple Store 是否只允许 ionic 的 InAppBrowser 查看网站?

xcode swift 获取互联网值(value)(货币)

android - 无法在 API 级别 23 以上添加运行时权限?

java - 谷歌地图向上滑动标记信息窗口