Vic*_*tor 3 styles ios gmsmapview swift
小智 5
您可以按照自己的方式自定义地图: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)")
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1747 次 |
| 最近记录: |