【问题标题】:Show blue location dot in Baidu Maps on iOS在 iOS 上的百度地图中显示蓝色位置点
【发布时间】:2024-01-19 21:22:01
【问题描述】:

我有一个应用一直在使用谷歌地图,我想添加百度地图。我添加了百度地图,可以显示地图并以用户当前位置为中心,但我无法显示蓝色位置点。

有人知道怎么做吗?

谷歌地图应用:

百度地图应用:

【问题讨论】:

  • 如果你想在谷歌地图中显示蓝色标记,yourMapView.myLocationEnabled = true
  • 我在谷歌地图上有。我需要让它显示在百度地图上。
  • 在百度地图文档中搜索当前位置启用选项。
  • 我已经彻底搜索过,但无法弄清楚。如果不先进行广泛的研究,我不会发布这个问题。我希望在这里找到自己实现它的人。

标签: ios swift baidu-map


【解决方案1】:

百度文档说

/ / The following mapView for the BMKMapView object / / display positioning layer 
mapView.showsUserLocation = true; / / set the positioning status to the normal positioning mode 
mapView.userTrackingMode = BMKUserTrackingModeFollowWithHeading;

你试过这些吗? 可以通过 gogle 翻译获得:http://lbsyun.baidu.com/index.php?title=iossdk/guide/create-map/location

并阅读:http://lbsyun.baidu.com/index.php?title=ios-locsdk 使用定位需要申请key

【讨论】:

  • 感谢您的回复。您需要钥匙才能完全显示地图。我有显示并以用户位置为中心的地图,它只是我无法工作的蓝色位置点。我的代码中有mapView.showsUserLocation = true,但没有使用userTrackingMode。我现在已经把它放进去,但仍然不能让它工作。
最近更新 更多