我正在编写一个应用程序来跟踪将其当前坐标(经度和纬度)发送到服务器的设备。我正在尝试使用 google maps api 不断更新 map 上的标记。然而,我在这方面非常不成功。
我正在解析来自服务器的数据,所以我有我需要将标记更新到的坐标。但是,如果我执行 marker.remove() 或 marker.setPosition(latilongi),应用程序只会绘制从服务器解析的最后一个坐标。
如果有人对如何实现能够运行 Android 应用程序并查看标记动态变化的影响有任何见解,将不胜感激!
提前致谢
最佳答案
您可以使用它来移动带动画的标记:
/**
* @param marker the operation marker
* @param finalPosition the destination latlng
* @param latLngInterpolator interpolator of animation
*/
static void animateMarkerToICS(Marker marker, LatLng finalPosition, final LatLngInterpolator latLngInterpolator)
关于Android - 使用 google maps api 动态更改标记的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27334633/