从mapView中删除用户位置注释 [英] Remove user location annotation from mapView

查看:148
本文介绍了从mapView中删除用户位置注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须删除添加到我的MKMapView的所有注释,但是当我执行时:

I have to remove all the annotations added to my MKMapView but when I execute :

NSMutableArray *annotationsToRemove = [[NSMutableArray alloc] initWithArray: mapView.annotations];
[mapView removeAnnotations: annotationsToRemove];

数组annotationsToRemove包含 MKUserLocation 注释和它不会删除它。

The array annotationsToRemove contains a MKUserLocation annotation and it doesn't delete it.

有没有办法重置地图?我需要删除它的所有注释!

Is there a way to reset the map? I need to delete all the annotations from it!

推荐答案

你可以设置 showsUserLocation 属性NO。

 mapView.showsUserLocation = NO;

这篇关于从mapView中删除用户位置注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆