我将 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/