我在我的 iOS 项目中使用 Google Maps SDK。我正在使用 Swift 和我想在 UIView 中显示 Google 地图,不带任何文本或标签。我能够正确显示地图,但无法从地图中删除文本...我在 Javascript 中看到了同样的问题,但无法在 Swift 中复制它(如何获得没有标签的地图?)...我想要地图的常规类型(kGMSTypeNormal)。有什么方法可以做到吗?
可以隐藏labels
, landmarks
and roads
.
do {
// Set the map style by passing the URL of the local file.
if let styleURL = Bundle.main.url(forResource: "mapStyle", withExtension: "json") {
self.mapView.mapStyle = try GMSMapStyle(contentsOfFileURL: styleURL)
} else {
print("Unable to find style.json")
}
} catch {
print("One or more of the map styles failed to load. \(error)")
}
Where 地图样式.json是我项目中的一个json文件。欲了解更多详情,请参阅谷歌文档.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)