let camera = GMSCameraPosition.camera(withLatitude: 36.80, longitude: 10.18, zoom: 2.0)
let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
mapView.delegate = self
view = mapView
// Creates a marker in the center of the map.
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: 36.80, longitude: 10.18)
marker.title = "Tunis"
marker.snippet = "Tunisia"
marker.map = mapView
let position = CLLocationCoordinate2D(latitude: 51.5, longitude: -0.127)
let london = GMSMarker(position: position)
london.title = "London"
london.map = mapView
Run Code Online (Sandbox Code Playgroud)
这是我的标志和点击它didtapMarker
委托方法被调用在我想x
,y
标志物的价值,以创建其中指出关于特定标记的一些信息视图.我怎样才能做到这一点?