MapView

作者: apple_2921 | 来源:发表于2018-06-20 16:32 被阅读0次

1.让大头针处于地图中央

self.mapView.centerCoordinate =  CLLocationCoordinate2DMake(<#CLLocationDegrees latitude#>, <#CLLocationDegrees longitude#>)


2.显示所有大头针

[self.mapView showAnnotations:self.annotationArr animated:YES];


3.大头针的点击事件

annotationView.canShowCallout=ture;此时点击大头针时弹出气泡框

annotationView.annotationannotation要有title这个属性,否则会报错

must implement title, or view (null) must have a non-nil detailCalloutAccessoryView when canShowCallout is YES。

annotation拥有了title属性但没赋值时,点击大头针不会弹出气泡,也不会响应其他点击事件。

在定义了其他点击事件的时候设置成annotationView.canShowCallout=false

相关文章

网友评论

      本文标题:MapView

      本文链接:https://www.haomeiwen.com/subject/yprxyftx.html