在这里,我上传了我的问题的图片,您可以在其中检查我选择的标记是否与原始标记重叠。我不知道原因这是我选择标记的代码
func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {
//Here I am checking that selected marker is not my current location marker
if marker != currentLocationMarker{
if let selectedMarker = mapView.selectedMarker {
selectedMarker.icon = UIImage(named : "scooterPin")
}
mapView.selectedMarker = marker
selectedScooterLocation = CLLocation(latitude: marker.position.latitude, longitude: marker.position.longitude)
marker.icon = UIImage(named : "selectedScooterPin")
currentLocationMarker.icon = UIImage(named : "currentLocationMarker")
mapView.animate(to: GMSCameraPosition.camera(withLatitude: marker.position.latitude, longitude: marker.position.longitude, zoom: mapView.camera.zoom))
}
return true
}