开发者

MKMapView returns bad userLocation

开发者 https://www.devze.com 2023-02-20 15:13 出处:网络
I checked the box in iterface builder t开发者_如何学JAVAo show user location on map and it works fine. I want to zoom the mapView to User location with using the regions and user location, but users l

I checked the box in iterface builder t开发者_如何学JAVAo show user location on map and it works fine. I want to zoom the mapView to User location with using the regions and user location, but users latitude and longitude are 0.000, and app is zooming to region with center 0 and 0. Why is this?

CLLocation *location = [[[CLLocation alloc] initWithLatitude:mapView.userLocation.location.coordinate.latitude longitude:mapView.userLocation.location.coordinate.longitude] autorelease];


Use CoreLocation to get user location, and not the map.

0

精彩评论

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