userLocation.coordinate给了我错误的值

userLocation.coordinate给了我错误的值

问题描述:

当我尝试使用userLocation.coordinate给了我错误的值

CLLocationCoordinate2D CurrentLocation; 
CurrentLocation = map.userLocation.coordinate; 

我得到的follwoing值来获得当前位置:

CurrentLocation.latitude= -180.000000; 
CurrentLocation.longitude= -180.000000; 

,这是不是我的位置在所有。

你知道这里缺少什么吗?

+0

你已经给你的位置作为Hame或Dameshq周围的环境,保持你的隐私。注意安全。 – RabinDev

首先,确保您已将mapView的showUserLocation设置为TRUE。

其次,检查值不为零,因为mapView需要先找到用户,而这需要几秒钟。

+0

我的载入已经把showUserLocation设置为TRUE。 哪个值我应该检查它是否为零? – asnanak

+0

'mapView.userLocation'或'mapView.userLocation.coordinate' –

+0

是的,map.userLocation.coordinate是-180.000000,map.userLocation.location.coordinate是0.000000 知道该应用程序完全显示我的位置。 – asnanak