草庐IT

CLLocationsCoordinate2

全部标签

ios - 一组 CLLocationsCoordinate2D 的中心坐标

在iOS中有没有办法获取一组CLLocationCoordinate2D的中心坐标? 最佳答案 嗯……这取决于你如何定义点的中心。它是否取决于分布等...一个简单的方法如下...//findrectthatenclosesallcoordsfloatmaxLat=-200;floatmaxLong=-200;floatminLat=MAXFLOAT;floatminLong=MAXFLOAT;for(inti=0;imaxLat){maxLat=location.latitude;}if(location.longitude>max