开发者

how to check if a point falls into a MKRect

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜