swift - 如何获取当前位置的带有浅蓝色字段的 iPhone map 应用程序蓝点?

标签 swift annotations mapkit

我认为这个标题是不言自明的。目前,当我为当前位置添加默认注释时:

let currentAnnot = MKPointAnnotation()
currentAnnot.coordinate = loc.coordinate
mainMap.addAnnotation(currentAnnot)

它给了我一个红色别针。我想要 Apple iPhone map 应用程序默认使用的带有浅蓝色字段的相同蓝点。是否有专门的名称?如何添加?

最佳答案

这是因为您要添加注释(图钉)而不是用户位置。

使用以下命令启用它

mapView.showsUserLocation = true

Also check out a tutorial which may help

关于swift - 如何获取当前位置的带有浅蓝色字段的 iPhone map 应用程序蓝点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33224044/

相关文章:

ios - 快速处理键盘重叠

c - Profile C代码执行百分比(逐行注释)

java - 在Java中,为什么@Nullable有运行时保留

swift - 错误 : 'Delegate must respond to locationManager:didUpdateLocations:' when collecting user location

swift - 在命令行上使用 Swift 导入

ios - 如何快速扩大命中区域?

ios - NSURLSession 返回元组的问题

java - 如何基于 URL 模式应用 Spring Boot 过滤器?

ios - Mapkit 中的当前位置

iphone - 按同一个按钮可以打开/关闭 MapKit 叠加吗?