проблема
Я хочу сделать переход экрана, когда я касаюсь круга, нарисованного с помощью GMSCircle, а не маркера или заголовка.
Я написал код ниже, но нажатие на кружок не показывает ничего в области отладки, и я не могу перейти.
Чего не хватает?
окружающая среда
swift4
Google Maps SDK для iOS
Xcode 9.4.1
import UIKit
import GoogleMaps
import CoreLocation
class ViewController: UIViewController, GMSMapViewDelegate{
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
// map
let camera = GMSCameraPosition.camera(withLatitude: 35.687396, longitude: 139.743924, zoom: 17)
let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
mapView.delegate = self
self.view = mapView
// mapView.isMyLocationEnabled
let circle = GMSCircle()
circle.position = CLLocationCoordinate2DMake(35.687396, 139.743924)
circle.radius = CLLocationDistance(10)
circle.fillColor = UIColor.blue
circle.isTappable = true
circle.map = mapView
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func mapView(_ mapView: GMSMapView, didTapCircle: GMSCircle) {
performSegue(withIdentifier: "goTalk", sender: nil)
}
}