Chr*_*ler 10 mkmapview cllocation ios ios7
我正在编写一个带有mapView的应用程序,其中显示了一些注释.
现在我想在mapView中显示用户的当前位置.我使用以下代码获取当前位置:
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)location
Run Code Online (Sandbox Code Playgroud)
我在日志中获得了当前位置的详细信息
2013-10-14 12:03:34.291 AppName[13200:a0b] (
"<+7.35000000,+47.32000000> +/- 5.00m (speed -1.00 mps / course -1.00) @ 10/14/13, 12:03:34 PM Central European Summer Time")
Run Code Online (Sandbox Code Playgroud)
现在我没有把这个位置放到mapView中作为这个蓝色脉冲点.
请给出一些提示.
inc*_*iko 29
您可以通过以下方式启用用户位置:
mapView.showsUserLocation = YES;
Run Code Online (Sandbox Code Playgroud)
如果你想以这个位置为中心:
[mapView setCenterCoordinate:mapView.userLocation.location.coordinate animated:YES];
Run Code Online (Sandbox Code Playgroud)
如果您正在使用:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
if ([annotation isKindOfClass:[MKUserLocation class]]) {
return nil;
}
// etc...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21191 次 |
| 最近记录: |