开发者

userLocation.coordinate gave me wrong value

when i try to get the current location using

CLLocationCoordinate2D CurrentLocation;
CurrentLocation = map.userLocation.coordinate;

i get the follwoing values:

CurrentLocation.latitude= -180.开发者_运维知识库000000;
CurrentLocation.longitude= -180.000000;

and it is not my location at all.

do you know what is missing in this?


Firstly, make sure that you have set the mapView's showUserLocation to TRUE.

Secondly, check that the value is not nil, as the mapView needs to locate the user first, and that takes a few seconds.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜