最佳答案
您可以在这里按照您想要的方式自定义 map :https://mapstyle.withgoogle.com/
完成自定义后,复制 json 并将其添加到您的项目文件中,比如 style.json
然后将此样式分配给您的 map :
do {
// Set the map style by passing the URL of the local file.
if let styleURL = Bundle.main.url(forResource: "style", withExtension: "json") {
mapView.mapStyle = try GMSMapStyle(contentsOfFileURL: styleURL)
} else {
NSLog("Unable to find style.json")
}
} catch {
NSLog("One or more of the map styles failed to load. \(error)")
}
关于ios - 使用 GMS 的 Swift map 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39311648/