ios - 获取设备位置而不在单点触控上显示蓝点

标签 ios iphone xamarin.ios mkmapview

有时需要您将 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/

相关文章:

ios - 无法从解析代码块中获取数组 PFQuery 对象

c# - 将值绑定(bind)到 Xamarin 中 View 的扩展

iphone - 继续不执行

ios - 如何在 Storyboard 中将 View 移动到另一个 View 内

ios - Xamarin iOS Designer xib 在文档大纲中缺少 'Files Owner' 、 'ViewController' 对象

ios - Int64 使用 SQLite 抛出 "Number overflow"

ios - Swift:在工具栏中添加完成、下一步、上一个功能

ios - 只有后退按钮和透明背景的导航

iphone - 如何使用 Assets Library 加速图像加载?

xamarin.forms - Xamarin.Forms、iOS、Android 中的后台服务