有时需要您将 map 中心设置在用户当前位置但不显示蓝点。假设您只想拥有该区域,但您不希望该用户专注于他在 map 上的位置。你想让他们专注于 map 的其他对象。
我们如何获取用户位置但不显示蓝点?
最佳答案
相当于 Tim 的答案的 Monotouch 是:
mapView .ShowsUserLocation =true ;
mapView.DidUpdateUserLocation += (sender, e) => {
if (mapView.UserLocation != null) {
CLLocationCoordinate2D location;
location.Latitude = mapView.UserLocation .Coordinate .Latitude ;
location.Longitude = mapView.UserLocation .Coordinate.Longitude;
mapView .CenterCoordinate =location ;
mapView .ShowsUserLocation =false ;
}
};
关于ios - 获取设备位置而不在单点触控上显示蓝点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14800909/