您可以在此处按照自己的方式自定义地图:https://mapstyle.withgoogle.com/
完成自定义后,复制json并将其添加到名为style.json的文件中
然后将此样式分配给您的地图,如下所示:
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)")
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句