【发布时间】:2014-01-09 09:17:41
【问题描述】:
我想根据从加速度计接收到的方位或传感器值旋转标记,以向用户显示他实际移动的位置。我已将标记图标和平面值设置为 true,但它没有按要求工作。
mCurrentLocationMarker.position(new LatLng(
LocationUtils.sLatitude, LocationUtils.sLongitude));
mCurrentLocationMarker.icon(icon);
mCurrentLocationMarker.flat(true);
mCurrentLocationMarker.rotation(LocationUtils.sBearing);
if (currentMarker != null) {
currentMarker.setPosition(new LatLng(
LocationUtils.sLatitude,
LocationUtils.sLongitude));
} else {
currentMarker = mGoogleMap
.addMarker(mCurrentLocationMarker);
}
animateCameraTo(true);
我用这个 作为标记。
我不知道为什么它没有按照用户的方向旋转。如果有人有任何想法,请帮助我在哪里犯错。
LocationUtils.sBearing 是我从 onLocationChanged 或加速度计接收到的轴承值。
基本上我想让我的标记与谷歌地图标记相同,它会向用户显示他们正在移动或转向的方向。
【问题讨论】:
-
嘘!对此有任何答案或stackoverflow.com/questions/33687236/… ?????
标签: android google-maps-markers accelerometer marker bearing