0

座標を使用して、ポイントがバウンディングボックス内にあるかどうかを知りたいです。

チェックするポイント:

CLLocation-> 48.847172 2.386597

バウンディングボックス:

maxLat minLat / maxLon minLon

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

どうすれば確認できますか?

4

1 に答える 1

5

だろうCGRectContainsPoint

bool CGRectContainsPoint (
  CGRect rect,
  CGPoint point
);

あなたのために働きますか?

CLLocationCoordinate2D次のCGPointように変換できます。

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