读书人

iOS 依据经纬度翻译成详细位置的各种方

发布时间: 2012-11-23 00:03:43 作者: rapoo

iOS 根据经纬度翻译成详细位置的各种方法

首先苹果获取经纬度是

    //开始点击长按,不然会执行2次。    if (sender.state==UIGestureRecognizerStateBegan) {        //isLongPress=YES;        CGPoint touchPoint=[sender locationInView:self.myMapView];        CLLocationCoordinate2D touchCoordinate=[self.myMapView convertPoint:touchPoint toCoordinateFromView:self.myMapView];//将触摸点转换经纬度        //反向解析长按时的大头针的信息        location =[[CLLocation alloc]initWithLatitude:touchCoordinate.latitude longitude:touchCoordinate.longitude]; }







读书人网 >操作系统

热点推荐