我正在使用 Here map api 在 android fragment 中显示 here map。我成功地以 fragment 形式显示了此处的 map 。但我无法在此处 map 的左角显示“我的位置”按钮。 (我正在使用高级计划) 那么,如何在 Here map 上显示我的位置按钮?
For google map api, we can add "My current location" button like explained in (How to display my location on Google Maps for Android API v2). I am looking for the same functionality using Here api.
最佳答案
HERE SDK 没有像 Google SDK 那样的内置位置按钮 UI。您必须自己实现按钮 UI,并让它在按下时调用 Map#setCenter(GeoCoordinate point, Animation animation)
[1]。您可以使用 PositioningManager#getPosition()
API [2] 将当前位置交给 setCenter
。
关于android - 如何在 Android 版 Here Maps 上显示我的位置按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45153699/