如何检测是否已点击标记?
这是我的代码:
let Meridian = GMSMarker()
Meridian.position = CLLocationCoordinate2D(latitude: 5.654874, longitude: 100.5320142)
Meridian.title = "Recycling Factory"
Meridian.snippet = "Meridian World Sdn Bhd"
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.showMeridianInfo))
Meridian.addGestureRecognizer(tapGesture)//here is where I get the error
@objc func showMeridianInfo (sender: UITapGestureRecognizer) {
print("meradin")
}
答案 0 :(得分:0)
你必须遵守SELECT a.* FROM questions as q, answers as a
WHERE a.question_id=q.id
并实施:
GMSMapViewDelegate
在此功能中,您可以访问所选的标记详细信息,如标题等。
func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {}