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

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

问题描述

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

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档案位于此处:

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天全站免登陆