开发者

how to check if a point falls into a MKRect

开发者 https://www.devze.com 2023-01-22 21:02 出处:网络
Does any 开发者_如何学JAVAone know of a MapKit function that returns a BOOL or something to indicate whether two MKMapRect intersect or contain?MapKit does contain some functions to help with this:

Does any 开发者_如何学JAVAone know of a MapKit function that returns a BOOL or something to indicate whether two MKMapRect intersect or contain?


MapKit does contain some functions to help with this:

BOOL contains = MKMapRectContainsRect(rect1, rect2);
BOOL intersects = MKMapRectIntersectsRect(rect1, rect2);

See the documentation for more details and other useful functions.


That's some fairly simple math, you could implement it yourself, or you could convert your MKMapRects to CGRects and use the CoreGraphics functions.

0

精彩评论

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