在MKMapview中设置区域的关系是1.6倍

时间:2012-08-10 04:35:06

标签: objective-c xcode4 mkmapview

-(void) setTheMapViewRegionBasedonCurrentAnchorandDistance
{
    //PD([BNUtilitiesQuick MaxDistanceOnSearch]);
    //self.theMapView.centerCoordinate = [cachedProperties singleton].currentAnchor.coordinate;
    //self.theMapView.region.span.longitudeDelta=[BNUtilitiesQuick MaxDistanceOnSearch]*safetyMarginForMap; 
    double ratio = self.theMapView.frame.size.height/self.theMapView.frame.size.width;
    //double ratio = self.theMapView.visibleMapRect.size.height/self.theMapView.visibleMapRect.size.width;
    PD([BNUtilitiesQuick MaxDistanceOnSearch]);
    double distanceFromEastAndWestShyouldBe = [BNUtilitiesQuick MaxDistanceOnSearch]*ratioBetweenEastWestToDistanceFilter;
    PD(distanceFromEastAndWestShyouldBe);
    self.theMapView.region = MKCoordinateRegionMakeWithDistance([cachedProperties singleton].mapCenterLocation.coordinate,distanceFromEastAndWestShyouldBe, distanceFromEastAndWestShyouldBe);
    PD(self.DistanceBetweenWestandEast);
    PD(ratio);
}

看看那段代码。我将MKMapview区域设置为distanceFromEastAndWestShyouldBe的数量。输出是:

    2012-08-10 11:30:13.789 BadgerNew[15438:17003] <0x874d0b0 GoogleMap.m:(394)> [BNUtilitiesQuick MaxDistanceOnSearch]: 193.690170
2012-08-10 11:30:13.789 BadgerNew[15438:17003] <0x874d0b0 GoogleMap.m:(396)> distanceFromEastAndWestShyouldBe: 464.856409
2012-08-10 11:30:13.790 BadgerNew[15438:17003] <0x874d0b0 GoogleMap.m:(398)> self.DistanceBetweenWestandEast: 761.369705
2012-08-10 11:30:21.329 BadgerNew[15438:17003] <0x874d0b0 GoogleMap.m:(399)> ratio: 1.437500

基本上我将地图设置为宽464米,地图宽度为761米。

MKMapview的高度和宽度之比为1.43。这并不重要,因为我使用较小的数字来表示纬度和经度。

在MKMapview中计算东西方实际差异的代码是:

-(double)DistanceBetweenWestandEast     
{
    CLLocationDegrees longitudeDelta=self.theMapView.region.span.longitudeDelta;
    double distanceeastwest = longitudeDelta * MetersIn1DegreeofEarth;
    return distanceeastwest;    
}

#define MetersIn1DegreeofEarth 110882.5

在其他地方定义

在更改mapview区域之前,解决方法只是除以1.6。但是,我想知道为什么它首先出现了。

2 个答案:

答案 0 :(得分:1)

经度线之间的距离随纬度而变化。赤道一度经度为~111km但北纬75度为一度经度为~29km。您对eastwestdistance的计算假定视图位于赤道上。尝试使用CLLocation的distanceFromLocation来考虑纬度。 你需要两点。中心 - 经度Delta / 2和中心+经度Delta / 2

答案 1 :(得分:0)

我发现了问题所在:

我写了这段代码:

  for (int i=100;i<10000;i=i*1.1)
    {
        distanceWereInputing = i;
        self.theMapView.region = MKCoordinateRegionMakeWithDistance([cachedProperties singleton].mapCenterLocation.coordinate,distanceWereInputing, distanceWereInputing);
        PD(distanceWereInputing);
        PD(self.DistanceBetweenWestandEast);
        PD(self.DistanceBetweenWestandEast/distanceWereInputing);
    }

结果如下:

2012-08-10 12:33:33.935 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(394)> [BNUtilitiesQuick MaxDistanceOnSearch]: 193.690170
2012-08-10 12:33:33.935 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(396)> distanceFromEastAndWestShyouldBe: 464.856409
2012-08-10 12:33:50.500 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 100.000000
2012-08-10 12:33:51.740 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 95.171213
2012-08-10 12:33:54.042 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 0.951712
2012-08-10 12:34:02.613 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 110.000000
2012-08-10 12:34:02.613 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 190.342426
2012-08-10 12:34:02.614 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.730386
2012-08-10 12:34:02.614 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 121.000000
2012-08-10 12:34:02.614 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 190.342426
2012-08-10 12:34:02.614 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.573078
2012-08-10 12:34:02.615 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 133.000000
2012-08-10 12:34:02.615 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 190.342426
2012-08-10 12:34:02.615 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.431146
2012-08-10 12:34:02.616 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 146.000000
2012-08-10 12:34:02.620 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 190.342426
2012-08-10 12:34:02.620 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.303715
2012-08-10 12:34:02.621 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 160.000000
2012-08-10 12:34:02.621 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 190.342426
2012-08-10 12:34:02.621 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.189640
2012-08-10 12:34:02.622 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 176.000000
2012-08-10 12:34:02.622 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 190.342426
2012-08-10 12:34:02.633 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.081491
2012-08-10 12:34:02.635 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 193.000000
2012-08-10 12:34:02.635 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 190.342426
2012-08-10 12:34:02.635 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 0.986230
2012-08-10 12:34:02.636 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 212.000000
2012-08-10 12:34:02.636 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 380.684853
2012-08-10 12:34:02.636 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.795683
2012-08-10 12:34:02.636 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 233.000000
2012-08-10 12:34:02.667 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 380.684853
2012-08-10 12:34:02.667 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.633841
2012-08-10 12:34:02.668 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 256.000000
2012-08-10 12:34:02.668 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 380.684853
2012-08-10 12:34:02.668 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.487050
2012-08-10 12:34:02.668 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 281.000000
2012-08-10 12:34:02.669 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 380.684853
2012-08-10 12:34:02.669 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.354750
2012-08-10 12:34:02.669 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 309.000000
2012-08-10 12:34:02.670 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 380.684853
2012-08-10 12:34:02.670 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.231990
2012-08-10 12:34:02.671 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 339.000000
2012-08-10 12:34:02.671 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 380.684853
2012-08-10 12:34:02.685 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.122964
2012-08-10 12:34:02.686 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 372.000000
2012-08-10 12:34:02.686 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 380.684853
2012-08-10 12:34:02.686 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.023346
2012-08-10 12:34:02.687 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 409.000000
2012-08-10 12:34:02.687 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 761.369705
2012-08-10 12:34:02.687 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.861540
2012-08-10 12:34:02.687 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 449.000000
2012-08-10 12:34:02.688 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 761.369705
2012-08-10 12:34:02.688 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.695701
2012-08-10 12:34:02.688 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 493.000000
2012-08-10 12:34:02.688 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 761.369705
2012-08-10 12:34:02.689 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.544360
2012-08-10 12:34:02.689 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 542.000000
2012-08-10 12:34:02.689 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 761.369705
2012-08-10 12:34:02.689 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.404741
2012-08-10 12:34:02.690 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 596.000000
2012-08-10 12:34:02.690 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 761.369705
2012-08-10 12:34:02.690 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.277466
2012-08-10 12:34:02.691 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 655.000000
2012-08-10 12:34:02.691 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 761.369705
2012-08-10 12:34:02.691 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.162396
2012-08-10 12:34:02.692 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 720.000000
2012-08-10 12:34:02.692 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 761.369705
2012-08-10 12:34:02.692 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.057458
2012-08-10 12:34:02.692 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 792.000000
2012-08-10 12:34:02.693 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 1522.739410
2012-08-10 12:34:02.693 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.922651
2012-08-10 12:34:02.693 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 871.000000
2012-08-10 12:34:02.693 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 1522.739410
2012-08-10 12:34:02.694 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.748266
2012-08-10 12:34:02.694 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 958.000000
2012-08-10 12:34:02.694 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 1522.739410
2012-08-10 12:34:02.694 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.589498
2012-08-10 12:34:02.695 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 1053.000000
2012-08-10 12:34:02.695 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 1522.739410
2012-08-10 12:34:02.695 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.446096
2012-08-10 12:34:02.695 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 1158.000000
2012-08-10 12:34:02.703 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 1522.739410
2012-08-10 12:34:02.703 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.314974
2012-08-10 12:34:02.704 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 1273.000000
2012-08-10 12:34:02.704 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 1522.739410
2012-08-10 12:34:02.704 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.196182
2012-08-10 12:34:02.705 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 1400.000000
2012-08-10 12:34:02.705 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 1522.739410
2012-08-10 12:34:02.705 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.087671
2012-08-10 12:34:02.706 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 1540.000000
2012-08-10 12:34:02.706 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 3045.478821
2012-08-10 12:34:02.706 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.977584
2012-08-10 12:34:02.707 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 1694.000000
2012-08-10 12:34:02.707 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 3045.478821
2012-08-10 12:34:02.707 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.797803
2012-08-10 12:34:02.707 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 1863.000000
2012-08-10 12:34:02.708 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 3045.478821
2012-08-10 12:34:02.708 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.634718
2012-08-10 12:34:02.708 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 2049.000000
2012-08-10 12:34:02.708 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 3045.478821
2012-08-10 12:34:02.709 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.486324
2012-08-10 12:34:02.709 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 2253.000000
2012-08-10 12:34:02.709 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 3045.478821
2012-08-10 12:34:02.710 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.351744
2012-08-10 12:34:02.710 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 2478.000000
2012-08-10 12:34:02.710 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 3045.478821
2012-08-10 12:34:02.710 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.229007
2012-08-10 12:34:02.711 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 2725.000000
2012-08-10 12:34:02.711 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 3045.478821
2012-08-10 12:34:02.711 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.117607
2012-08-10 12:34:02.712 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 2997.000000
2012-08-10 12:34:02.712 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 3045.478821
2012-08-10 12:34:02.712 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.016176
2012-08-10 12:34:02.713 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 3296.000000
2012-08-10 12:34:02.713 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 6090.957642
2012-08-10 12:34:02.713 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.847985
2012-08-10 12:34:02.714 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 3625.000000
2012-08-10 12:34:02.714 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 6090.957642
2012-08-10 12:34:02.714 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.680264
2012-08-10 12:34:02.714 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 3987.000000
2012-08-10 12:34:02.715 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 6090.957642
2012-08-10 12:34:02.715 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.527704
2012-08-10 12:34:02.715 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 4385.000000
2012-08-10 12:34:02.715 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 6090.957642
2012-08-10 12:34:02.716 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.389044
2012-08-10 12:34:02.716 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 4823.000000
2012-08-10 12:34:02.716 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 6090.957642
2012-08-10 12:34:02.716 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.262898
2012-08-10 12:34:02.717 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 5305.000000
2012-08-10 12:34:02.717 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 6090.957642
2012-08-10 12:34:02.717 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.148154
2012-08-10 12:34:02.718 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 5835.000000
2012-08-10 12:34:02.718 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 6090.957642
2012-08-10 12:34:02.718 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.043866
2012-08-10 12:34:02.719 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 6418.000000
2012-08-10 12:34:02.719 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 12181.915283
2012-08-10 12:34:02.719 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.898086
2012-08-10 12:34:02.719 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 7059.000000
2012-08-10 12:34:02.720 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 12181.915283
2012-08-10 12:34:02.720 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.725728
2012-08-10 12:34:02.720 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 7764.000000
2012-08-10 12:34:02.720 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 12181.915283
2012-08-10 12:34:02.721 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.569026
2012-08-10 12:34:02.721 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 8540.000000
2012-08-10 12:34:02.721 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 12181.915283
2012-08-10 12:34:02.721 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.426454
2012-08-10 12:34:02.722 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(403)> distanceWereInputing: 9394.000000
2012-08-10 12:34:02.722 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(404)> self.DistanceBetweenWestandEast: 12181.915283
2012-08-10 12:34:02.722 BadgerNew[16754:17003] <0x88b79b0 GoogleMap.m:(405)> self.DistanceBetweenWestandEast/distanceWereInputing: 1.296776

所以看起来Google Zoom等级只能取一定的价值。这就是为什么我们输入的东西与实际的东西距离之间的比率从1.7到0.95不等。

所以我只取平均值1.3并在更改MKMapview大小时使用它。