相关疑难解决方法(0)

从MKMapView获取用户位置

是否可以使用MKMapView自己的位置管理器返回用户当前位置以传递到Web服务?

我有mapView.showsUserLocation=YES;,这确实在我的位置返回一个有效的蓝点,但在模拟器中,它的库比蒂诺 - 这很好,但当我看到

mapView.userLocation.coordinate.latitude,它等于180,而CLLocationManager返回正确的,37.3317.

我想避免为我的三个选项卡设置多个位置管理器,因此使用mapViews会有所帮助.

谢谢.

iphone core-location mkmapview

27
推荐指数
1
解决办法
3万
查看次数

如何使用给定的用户位置初始化MKMapView?

我的应用程序知道当前用户位置(CoreLocation.framework).一旦用户打开新的MapView,他的iPhone就会再次开始搜索当前位置.是否可以跳过它或更改mkMapView的第一个用户位置?

编辑:

是否可以覆盖MKMapView并使用其他LocationManager?

iphone cocoa-touch core-location mkmapview

19
推荐指数
2
解决办法
5万
查看次数

如何在iPhone中获取当前位置

我在iPhone上制作谷歌地图集成.我必须在地图中显示当前位置.我如何获得当前位置?

谢谢

iphone mapkit

1
推荐指数
1
解决办法
1万
查看次数

使用CLLocationCoordinate2D获取当前位置

我试图使用CLLocationCoordinate2D获取用户的当前位置.我希望格式的值如

CLLocationCoordinate2D start = {-28.078694,153.382844};

所以我可以使用它们如下:

 NSString *urlAddress = [NSString 
       stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f",  
       start.latitude, start.longitude, 
       destination.latitude, destination.longitude];  
Run Code Online (Sandbox Code Playgroud)

我用了

CLLocation *location = [[CLLocation alloc]init ];
CLLocationDegrees currentLatitude = location.coordinate.latitude;
CLLocationDegrees currentLongitude = location.coordinate.longitude;
Run Code Online (Sandbox Code Playgroud)

获得当前的lat和long.

但是当我尝试测试时,我得到了0.000.我在iPhone 4s上测试.

如果有任何示例代码,那就太棒了.

iphone objective-c cllocationmanager ios

1
推荐指数
2
解决办法
3万
查看次数