放大和缩小后,MKMapview注释出错

时间:2011-09-13 07:34:33

标签: iphone objective-c xcode mkmapview

我正在使用带有许多注释的MKMapView。一切都很好,直到我放大并缩小我的地图。一些注释的位置相互切换。谁知道为什么? 这是我在viewDidLoad之后调用的代码,用于从3个数组中导入注释:经度,纬度和photoFileName。 photoFileName包含所有注释的照片文件名,经度和纬度包含它们的坐标。

for (int i=0; i<[longitudes count]; i++)
CLLocation* location = [[CLLocation alloc] initWithLatitude:[latitudes objectAtIndex:i]
            longitude:[longitudes objectAtIndex:i]];
CSMapAnnotation* annotation = [[CSMapAnnotation alloc] initWithCoordinate:[location coordinate]
            annotationType:CSMapAnnotationTypeImage
            title:@"";
            subtitle:@"";

// Set data for the annotation. This data is used for displaying annotation
[annotation setUserData:[photoFilename objectAtIndex:i]];

[_mapView addAnnotation:annotation];
[annotation release];
[currentLocation release];

}

所有内容都正常,滚动和缩放工作正常。但是,当我放大mapview(大约5-10倍),然后再缩小到第一个大小时,会更改一些注释位置(请参阅底部注释)。 我没有在这里发布函数viewForAnnotation,因为它没有被调用,我只是放大/缩小它发生了。 http://cC8.upanh.com/27.800.35078007.mF80/1.png http://cC9.upanh.com/27.800.35078008.AWG0/2.png

0 个答案:

没有答案
相关问题