GMSMapView显示空白地图 [英] GMSMapView show blank map

查看:255
本文介绍了GMSMapView显示空白地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I add GMSMapView into my screen but I only can see my position icon and the marker i added. Why i cant see the road, building, etc?

以下是我的代码:

Here is my code :

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

任何建议?

推荐答案

有一个空白地图的主要原因之一是密钥设置不当

One of the main reason to have a blank map is that the key is not set properly

您是否正确设置了API密钥。

Did you set the API key correctly.

[GMSServices provideAPIKey:yourAPIKey];

这篇关于GMSMapView显示空白地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆