-1
for(AnnotationView* annotation in self.mapView.annotations)
{
    topLeftCoord.longitude = fmin(topLeftCoord.longitude, annotation.coordinate.longitude);
    topLeftCoord.latitude = fmax(topLeftCoord.latitude, annotation.coordinate.latitude);

    bottomRightCoord.longitude = fmax(bottomRightCoord.longitude, annotation.coordinate.longitude);
    bottomRightCoord.latitude = fmin(bottomRightCoord.latitude, annotation.coordinate.latitude);
}

このループが最初の注釈、最後の注釈、またはすべての注釈の緯度と経度を保存するか? 私を明確にしてください...

4

1 に答える 1

0

これは のすべての要素を通過しannotations、既存のすべての注釈を囲むボックスを作成するポイントを表す注釈を「作成」します。

このようなもの:

配列内のすべての注釈が緑色の注釈であると仮定します。for ループは基本的に通過し、topLeftCoordの緯度と経度の値を左上の点 (赤い点) とbottomRightCoord等しくし、 の緯度と経度の値を右下の点 (もう一方の赤色の点) と等しくします。

ビジュアル マッピング

于 2013-10-31T14:48:51.183 に答える