MapBox 用户位置图标 (Android) [英] MapBox User Location Icon (Android)

查看:60
本文介绍了MapBox 用户位置图标 (Android)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Android 应用程序使用 MapBox,我需要修改用于指示当前用户位置和方向的标准蓝色点".

I use MapBox for my Android App, and I need to modify the standard blue "dot" that is used to indicate the current user location and orientation.

我发现这个线程表明过去的 MapBox Android API 提供了修改用户位置图标的方法:https://github.com/mapbox/mapbox-android-sdk-legacy/issues/717

I found this thread indicating that past MapBox Android APIs offered methods to modify the User Location Icon: https://github.com/mapbox/mapbox-android-sdk-legacy/issues/717

该线程提到了这些方法:

The thread mentions these methods:

mapView.getUserLocationOverlay().setDirectionArrowBitmap();
mapView.getUserLocationOverlay().setPersonBitmap();

最新的 MapBox Android SDK 没有显示这些方法.有谁知道这些方法的替代方法或修改用户位置图标的替代方法?

The newest MapBox Android SDK does not show these methods. Does anyone know replacements for these methods or alternatives to modifying the User Location Icon?

maven 存档在这里:http://grepcode.com/file/repo1.maven.org/maven2/com.mapbox.mapboxsdk/mapbox-android-sdk/0.7.4/com/mapbox/mapboxsdk/overlay/UserLocationOverlay.java#UserLocationOverlay.setDirectionArrowBitmap%28com.mapbox.mapboxsdk.overlay.Bitmap%29

The maven archive is here: http://grepcode.com/file/repo1.maven.org/maven2/com.mapbox.mapboxsdk/mapbox-android-sdk/0.7.4/com/mapbox/mapboxsdk/overlay/UserLocationOverlay.java#UserLocationOverlay.setDirectionArrowBitmap%28com.mapbox.mapboxsdk.overlay.Bitmap%29

推荐答案

MapBox 回应了澄清这些方法的替代方案的请求,他说:

MapBox responded to a request to clarify replacements for these methods, saying:

至于更改自定义标记的位置以显示移动,最好的办法是在需要显示进度时添加和删除标记.根据您需要多快刷新位置,这种方法可能看起来有点不稳定,但这是目前最好的解决方法.这将通过

As for changing location of a custom Marker to show movement, the best bet is to add and remove Markers when you need to show progress. Depending on how quickly you need to refresh the location, this approach might look a bit choppy, but it is the best workaround at this point. This would be done via

MapView.addMarker()

MapView.removeAnnotation()

这不是一个理想的解决方案,但现在应该可以完成工作.

That is not an ideal solution, but it should get the job done for now.

这篇关于MapBox 用户位置图标 (Android)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆