开发者

How do I test if a CLLocationCoordinate2D is visible in the current MKMapView?

I have many pins on my map and I want to animate the callout for the most visible pin. How开发者_JAVA技巧 can I check to see if the CLLocationCoordinate2D of a pin is visible or closest to the center?


This might solve ur query

  MKMapPoint userPoint = MKMapPointForCoordinate(_mapView.userLocation.location.coordinate);
    MKMapRect mapRect = _mapView.visibleMapRect;
    BOOL inside = MKMapRectContainsPoint(mapRect, userPoint);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜