开发者

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

开发者 https://www.devze.com 2023-03-12 20:30 出处:网络
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?T

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

精彩评论

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