0

在我的 iOS 项目中,我使用的是 skobbler 的 SKMapView,我需要在 mapview 上使用注释来显示用户的当前位置。我尝试了以下代码来做同样的事情:

    mapView.settings.followUserPosition = true
    mapView.settings.showCurrentPosition = true

而且我在应用程序中具有位置访问权限(WhenInUse Location access)。但是没有显示注释。任何帮助表示赞赏。

4

1 回答 1

1

我已经联系了 skobbler 团队,应确保以下事项以获取用户的当前位置

  1. 在 Info plist 中添加 NSLocationWhenInUseUsageDescription。

  2. 设置显示当前位置为真

    mapView.settings.showCurrentPosition = true
    
  3. 从 SKPositionerService 请求位置更新

    SKPositionerService.sharedInstance().startLocationUpdate()
    
于 2017-02-27T16:20:54.863 回答