0

I wanna know if my point is in my bounding box using coordinates:

point to check:

CLLocation -> 48.847172 2.386597

bounding box :

maxLat minLat / maxLon minLon

"48.7998602295",
"48.8198640442",
"2.46138595581",
"2.48138619423"

how can i check that ?

4

1 回答 1

5

CGRectContainsPoint

bool CGRectContainsPoint (
  CGRect rect,
  CGPoint point
);

为你工作?

您可以将 aCLLocationCoordinate2D转换为CGPoint这样的:

CGPoint p = (CGPoint) { loc.latitude, loc.longitude };
于 2013-01-25T11:50:47.420 回答