[英]How to create a Location arrow Marker with Sensor bearing in Android Google Maps v2?
I have managed to create an arrow ImageView
and get the azimuth from the sensors, after that I rotate the ImageView
using setRotation()
method of the View
class. 我设法创建一个箭头
ImageView
并从传感器获取方位角,之后我使用View
类的setRotation()
方法旋转ImageView
。 How I can do this for a marker using Android Google Maps v2 Markers? 如何使用Android Google Maps v2 Markers为标记执行此操作?
I suggest you take a look at the android-maps-utils project from Google. 我建议你看看谷歌的android-maps-utils项目。
It contains 它包含
This should give you the building blocks you need to display your arrow/marker and give it a certain rotation. 这应该为您提供显示箭头/标记并给它一定旋转所需的构建块。 You'll probably need to customize the rotationlayout a bit.
您可能需要稍微自定义rotationlayout。
you can use: https://developers.google.com/maps/documentation/android/marker#rotate_a_marker 您可以使用: https : //developers.google.com/maps/documentation/android/marker#rotate_a_marker
com.google.android.gms.maps.model.Marker marker = addMapMarker(camera,PrefManager.getCurrentUsername(getActivity()),
BitmapDescriptorFactory.fromResource(R.drawable.overlay_gps_location_scanner_icon));
marker.setRotation(0);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.