试图在ios中获取y相对于mapview注释的位置

时间:2015-07-24 11:04:45

标签: ios

- (void)mapView:(MKMapView *)mapView  annotationView:(MKAnnotationView *)annotationView
didChangeDragState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState
{
NSLog(@"%lu   newws %lu",(unsigned long)newState,(unsigned long)oldState);

if (newState == MKAnnotationViewDragStateEnding)
{
    CLLocationCoordinate2D droppedAt = annotationView.annotation.coordinate;


    NSLog(@"y is %f", annotationView.center.y);


    //  [self mapReload];
    NSLog(@"dropped at %f,%f", droppedAt.latitude, droppedAt.longitude);
    annotationView.dragState = MKAnnotationViewDragStateNone;

}


}

IN IOS 6 FOR IPOD

它显示与设备相关的错误位置

输出:

2015-07-24 16:00:45.159 eiKard[481:907] y is 1944388.000000
2015-07-24 16:00:45.165 eiKard[481:907] dropped at 12.998819,80.113608

但在其他设备和IOS中我的位置正确

输出:

2015-07-24 15:53:15.127 eiKard[481:907] y is 342.000000
2015-07-24 15:53:15.133 eiKard[481:907] dropped at 12.998819,80.113608

我认为IOS6在整个MAPVIEW中占据一席之地

当我下载注释时,我想获得设备的正确性

1 个答案:

答案 0 :(得分:0)

尝试MKMapView的以下功能:

- convertCoordinate:toPointToView:

请参阅documentation ...