加速度計から受け取ったベアリングまたはセンサーの値に応じてマーカーを回転させて、ユーザーが実際にどこに移動しているかを表示します。マーカーアイコンとフラット値をtrueに設定しましたが、必要に応じて機能しません。GoogleマップV2でユーザー方向別にマーカーを回転させます。
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または加速度計から受け取ったBearingの値です。
基本的に私は自分のマーカーを移動方向や向きを変えているユーザーを示すgoogle mapsマーカーと同じにします。
boo !!!これに関するすべての回答またはhttps://stackoverflow.com/questions/33687236/rotate-marker-as-per-user-direction-on-google-maps-v2-android ????? – Stella