1
我想创建一个Google地图标记的信息窗口,以在我的iOS应用程序的信息窗口内提供按钮点击事件。有没有办法做到这一点?按钮点击地图标记信息窗口内的事件
我想创建一个Google地图标记的信息窗口,以在我的iOS应用程序的信息窗口内提供按钮点击事件。有没有办法做到这一点?按钮点击地图标记信息窗口内的事件
希望这可以帮助你
extension ViewController: MKMapViewDelegate {
func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {
if annotation is MKUserLocation {
return nil
}
let identifier = "MyCustomAnnotation"
var annotationView = mapView.dequeueReusableAnnotationViewWithIdentifier(identifier)
if annotationView == nil {
annotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: identifier)
annotationView?.canShowCallout = true
} else {
annotationView!.annotation = annotation
}
let myButton = UIButton()
annotationView?.leftCalloutAccessoryView = myButton
return annotationView
}
}
谢谢。但我没有使用地图套件。 – user3480213
对不起,我没有看到:\ –
我发现从2013年这段视频,希望这可以帮助你:https://www.youtube.com/watch?v=ILiBXYscsyY –
和计算器另一个话题: http://stackoverflow.com/questions/16746765/custom-info-window-for-google-maps –