如何在swift中的谷歌地图中创建标记的自定义视图

时间:2018-04-26 19:40:00

标签: ios swift google-maps swift3 google-maps-markers

1 个答案:

答案 0 :(得分:0)

这里有关于如何添加标记的documentation

具体来说,这几行:

let position = CLLocationCoordinate2D(latitude: 10, longitude: 10)
let marker = GMSMarker(position: position)
marker.title = "Hello World"
marker.icon = GMSMarker.markerImage(with: .black) // or any image here
marker.map = mapView